It compares two operands and display the result either true or false.
Operators |
Description |
< |
Less than |
> |
Greater than |
<= |
Less than or equal to |
>= |
Greater than or equal to |
== |
Equal to |
!= |
Not equal to |
<> |
Not equal to(similar to !=) Note: It is not supported in python3 version |
Example
Program:
print("10<20:",10<20)
print("10<=20:",10<=20)
print("10>20:",10>20)
print("10>=20:",10>=20)
print("10==20:",10==20)
print("10!=20:",10!=20)
print("10<>20:",10<>20)
Output:
10<20: True
10<=20: True
10>20: False
10>=20: False
10==20: False
10!=20: True
10<>20: True
Comments
Post a Comment