Relational Operators
Relational operators are also called comparison operators. It performs a comparison between two values. It returns a boolean value True or False depending upon the result of the comparison. Python has the following six relational operators.
<(Less than)>(Greater than)<=(Less than or equal to)>=(Greater than or equal to)==(Equal to)!=(Not equal to)
Example:
x = 5
y = 2
print('x>y is', x>y)
print('x<y is', x<y)
print('x==y is', x==y)
print('x!=y is', x!=y)
print('x>=y is', x>=y)
print('x<=y is', x<=y)
Output:
x>y is True
x<y is False
x==y is False
x!=y is True
x>=y is True
x<=y is False