How to Compare Two Values in Python


In this example we will show how to compare two values and get the Boolean answer in Python.

Source Code

print(1 > 2)
print(1 == 2)
print(1 < 2)

Output:

False
False
True
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments