Comparison Operators

Comparison operators are used to compare one value with another. All of the following examples produce a Boolean answer of True or False.

Equality (the same as)

16 == 18  # False

Inequality (not the same as)

16 != 18  # True

Greater than

16 > 18  # False

Greater than or equal to

16 >= 18  # False

Less than

16 < 18  # True

Less than or equal to

16 <= 18  # True