Programmer’s Picnic – AI / ML Internship Track
Python has a special data type called bool.
True
False
True and False are keywords👉 Every condition in Python finally becomes True or False.
print(10 > 5) # True
print(10 < 5) # False
print(10 == 10) # True
print(10 <= 9) # False
Comparison operators always return a Boolean value.
Choose numbers:
Compare:
Logical operators combine Boolean values.
and → both must be True
or → any one True
not → reverses the value
True and False → False
True or False → True
not True → False
Select Boolean values:
A: B:bool)