Comparison Operators

'''
Created on Apr 21, 2021

@author: hp
'''
print("****Comparison Operators****")
'''
Operator       Name                        Example    
==            Equal                        x == y    
!=            Not equal                    x != y    
>             Greater than                 x > y    
<             Less than                    x < y    
>=            Greater than or equal to     x >= y    
<=            Less than or equal to        x <= y
'''
print("1st equal ==:")
x=10
y=10
print("If value is",x, "or", y, " is equal:",x==y)
print("\n2nd Not equal !=:")
x=10
y=1
print("If value is",x, "or", y, "is not equle :",x!=y)
print("\n3rd Greater than >:")
x=10
y=12
print("If value ",x,  "is grater than ", y ,"result is ",x!=y)

print("\n4th  Less than <:")
x=24
y=20
print("if value",x,"is less than",y,"result is :",x=:")
x=24
y=20
print("if value",x,"is Greater than or equal to ",y,"result is :",x>=y)
 
print("\n6th Less than or equal to <=")
x=20
y=30
print("if value", x, "is Less than or equal to",y,"Result is :",x<=y )

Comments