TECHIES WORLD

For Techs.... Techniques.... Technologies....

CpanelLinuxPython

How to do comparison of numbers in Python

Python relational operators can be used to do the comparison of numbers.

Please see the examples of different operators in Python.

==
    (a == b) is not true.

!=
    (a != b) is true.

>
    (a > b) is not true.

<
    (a < b) is true.

>=
    (a >= b) is not true.

<=
    (a <= b) is true.

We need to replace the values of a and be accordingly.

That's all…

Leave a Reply