Skip to content

Relational Operators

Relational Operators returns boolean value on the condition.

Below program implements all the different types of Relational Operations one can use in Python.

x = 5
y = 3

# Greater than
print(x > y)

# Less than
print(x < y)

# Equals
print(x == y)

# Not equals
print(x != y)

# Greater than equals to
print(x >= y)

# Less than equals to
print(x <= y)

Output

True
False
False
True
True
False