What are the comparison (relational) operators?

  • ==    Equal to
  • !=     Not equal to
  • >      Less than
  • <      Greater than
  • >=    Less than or equal to
  • <=    Greater than or equal to
#examples
>>> a=99
>>> b=3
>>> c=3

>>> a==c
False

>>> a!=b
True

>>> a>b
True

>>> b>=c
True

>>> c<=b
True

 

 

Advertisements