Python program to perform the relational operations
kw.py
print("__________________________________________")
print("Program for the relational operations")
print("__________________________________________")
a=b=3
print("Value of a |",a)
print("Value of b |",b)
print("__________________________________________")
c=(a==b)
print("3==3 |",c)
c=(a!=b)
print("3!=3 |",c)
c=(a<b)
print("3<3  |",c)
c=(a>b)
print("3>3  |",c)
c=(a<=b)
print("3<=3 |",c)
c=(a>=b)
print("3>=3 |",c)
print("__________________________________________")
Output
kodingwindow@kw:~$ python3 kw.py
__________________________________________
Program for the relational operations
__________________________________________
Value of a | 3
Value of b | 3
__________________________________________
3==3 | True
3!=3 | False
3<3  | False
3>3  | False
3<=3 | True
3>=3 | True
__________________________________________
Advertisement