Skip to main content

Boolean and Comparison Operators

Boolean Operators

True and True = True
True and False = False
False and True = False
False and False = False


This is the python 3 programming language where we are we are comparing True and False


When using "and" it will only be true when using "True and True" anything else is False

True or True = True
True or False = True
False or True = True
False or False = False

Here we are using "or" Boolean Operator


When using "or" it will only be False when using "False or False" anything else is True

another way of seeing it is when using "or" you have 3 x true and when using "and" you have 3 x False

Comparison Operators

<     = Less than
>     = Greater than
<=    = Less than or equal to
>=    = Greater than or equal to
==    = Equal to
!=    = Not equal to

Image of the Python IDLE terminal where we can write Python code
Here we can see that all the comparing is equal to True
 Comparison Operators compare the number on each side and it can only be True or False

Comments