Python Comparators

  • == equal
  • != not equal
  • < less than
  • <= less than or equal to
  • > greater than
  • >= greater than or equal to

Coercion

x = 5
y = 5.0
print(x == y)


Coercion

x = 5
y = 5.0
print(x == y)

True

Strings

a = "First"
b = "fir"
print(a < b)


Strings

a = "First"
b = "fir"
print(a < b)

True

Order of Operations

  1. Mathematical Operators
  2. Boolean Comparators
  3. not Operator
  4. and Operator
  5. or Operator