Comparison Operators¶
2 == 2
2 == 1
'hello == 'bye'
'Bye' == 'bye'
'2' == 2
2.0 == 2
3 != 3
4 != 5
2 > 1
1 < 2
1 < 2
2 < 5
2 >= 2
4 <= 1
Chaining Comparison Operators with Logical Operators¶
-
We can use logical operators to combine comparisons:
- and
- or
- not