Create a Python code that will accept two numbers from the user and prints "True" if it satisfies the condition and "False" otherwise. Use comparison operators ">", "<=", "!=", ">=", and "<".
# if number only integers use int, if number integer and float use - float
num1 = int(input('Input first number:'))
num2 = int(input('Input second number:'))
print('True' if num1 > num2 else 'False')
print('True' if num1 <= num2 else 'False')
print('True' if num1 != num2 else 'False')
print('True' if num1 >= num2 else 'False')
print('True' if num1 < num2 else 'False')
OUTPUT:
Input first number:25
Input second number:36
False
True
True
False
True
Comments
Leave a comment