Instructions
Syntax
condition1 and condition2Logical Operators (and, or, not) 🧠
Oru condition-a check panna if use panrom. Aana rendu moonu condition-a orey nerathula check pannanum na? Adhuku dhaan Logical Operators varudhu!
The Three Main Operators
| Operator | Meaning | Namba Basha (Tanglish) |
|---|---|---|
and | Rendu pakkamum True aaganum. | "Idhuvum venum, Adhuvum venum!" |
or | Edhavadhu onnu True aana podhum. | "Idhu illana Adhu paravala!" |
not | Irukardha apdiye reverse pannum. | "True na False, False na True!" |
Examples
1. and (Strict Security Guard 👮♂️)
Movie ku poga Ticket-um venum, 18 vayasu mela irukkanum. Rendum irundha dhaan ulla viduvanga!
age = 20
has_ticket = True
if age >= 18 and has_ticket:
print("Padathuku ulla polam!")
else:
print("Veliye nillu thambi!")
2. or (Chill Security Guard 😎)
Biriyani vanga Aadhar card illana Voter ID, edhavadhu onnu irundha podhum.
has_aadhar = False
has_voter_id = True
if has_aadhar or has_voter_id:
print("Innaikaikku Biriyani dhaan!")
3. not (Opposite aalu 🔄)
Mazhai peyyala na veliya povom. is_raining oda opposite-a check panna not use panrom.
is_raining = False
if not is_raining:
print("Veliya polam, jolly-a!")
🔍 Deep Dive: Truth Tables (Nijamum Poiyum)
Python eppadi idha yosikkudhu nu innum deeply paakalama? Idhuku peru "Truth Table". Rendu values vachi check pannum podhu ena mudivu varum nu paapom.
and (Rendum venum):
True and True➡️True(Rendum ok, allowed!)True and False➡️False(Onnu miss aagiduchu, so NOT allowed!)False and False➡️False(Rendume illa, veliya po!)
or (Edhachu onnu podhum):
True or False➡️True(Onnu ok-na kooda allowed!)False or True➡️True(Edho onnu irukku, so allowed!)False or False➡️False(Rendume illana dhaan fail aagum!)
not (Strict-a Opposite):
not True➡️Falsenot False➡️True
Idha theliva purinjikka indha interactive Logic Gate-a try pannunga:
💡 Did You Know? Matha programming languages-la
and-ku&&poduvanga,or-ku||poduvanga. Aana Python-la romba simple-a English word dhaan (and,or,not) use pannuvanga!
Your Turn! (Unga neram!)
Oru variable is_sunny create panni True nu set pannunga. Innoru variable is_weekend create panni True nu set pannunga.
Rendum True aana, "Go to the beach!" nu print pannanum.