0% found this document useful (0 votes)
6 views1 page

Python Relational Operators Explained

The document takes two numbers as input from the user and then prints the results of comparing the numbers using relational operators like >, <, ==, <=, >=. It also checks if each number falls in the range between 10-20 and prints the results.

Uploaded by

Jozu the Great
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Python Relational Operators Explained

The document takes two numbers as input from the user and then prints the results of comparing the numbers using relational operators like >, <, ==, <=, >=. It also checks if each number falls in the range between 10-20 and prints the results.

Uploaded by

Jozu the Great
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

a = int(input("Enter your first number : "))

b = int(input("Enter your second number : "))

print("First number, in relation to the second number is:")


greater = a>b
print("Greater: " +str(greater))

lesser = a<b
print("Lesser: " +str(lesser))

equal = a==b
print("Equal: " +str(equal))

lesser_equal = a<=b
print("Less than or equal: " +str(lesser_equal))

greater_equal = a>=b
print("Greater than or equal: " +str(greater_equal))

a_range = a in range(10,21)
print("First number in between 10 - 20: " +str(a_range))

b_range = b in range(10,21)
print("Second number in between 10 - 20: " +str(b_range))

You might also like