5 Dec 2020

Comparison(Relation) operators

 Comparison operators are used to compare values. It either returns True or False according to the condition.

                  

Example :

a=10
b=5
print("a>b=>",a>b)
print("a>b=>",a<b)
print("a==b=>",a==b)
print("a!=b=>",a!=b)
print("a>=b=>",a<=b)
print("a>=b=>",a>=b)

Output:
true
false
false
true
false
true

No comments:

Post a Comment

Operator precedence

           When an expression contains more than one operator, the order of evaluation depends on the order of operations.            The ac...