Python uses Boolean variables to evaluate conditions. The Boolean values True and False are returned when an expression is compared or evaluated. For example:

x = 2
print(x == 2) # prints out True
print(x == 3) # prints out False
print(x < 3) # prints out True

Trinket.io on-line Python compiler

Notice that variable assignment is done using a single equals operator “=“, whereas comparison between two variables is done using the double equals operator “==“. The “not equals” operator is marked as “!=“.