Python Basics – Comparison Operators

Comparison Operators

  • Equality :  == , !=
  • Order: < , > , <= , >=

Assignment Operator

  • Assignment : =

 

Equality Comparisons

  • datetimes
  • numbers ( float / int )
  • dictionaries
  • strings

Comparing different types

Not equal operator

Order operators

  • Less than <
  • Less than or equal <=
  • Greater than >
  • Greater than or equal >=

 

 

Order comparisons across types

Examples