Key Concepts

Review core concepts you need to learn to master this subject

Comparison Operators

a = 2 b = 3 a < b # evaluates to True a > b # evaluates to False a >= b # evaluates to False a <= b # evaluates to True a <= a # evaluates to True

In Python, relational operators compare two values or expressions. The most common ones are:

  • < less than
  • > greater than
  • <= less than or equal to
  • >= greater than or equal too

If the relation is sound, then the entire expression will evaluate to True. If not, the expression evaluates to False.