Knowledge organisersBoolean Expressions
== != < > <= >=
Comparison operators compare two values and return True or False. They are used in conditions for if statements, while loops, and other decision structures.
== equal to (not = which is assignment)!= not equal to< less than, > greater than<= less than or equal, >= greater than or equalTrue or False (a bool)age = 16
print(age == 16) # True
print(age != 18) # True
print(age >= 18) # False
print(age < 21) # True