Learn Python
Number
4.3
Lesson

Comparing numbers

We can compare two numbers and find the relation between them by using the following comparison operators:

  • Equal to: ==

  • Not equal to: !=

  • Less than: <

  • Greater than: >

  • Less than or equal to: <=

  • Greater than or equal to: >=

The result of the comparison will be either True or False.