Comparing heights: Andy and Ben

Report a typo

Write a Python program that reads two integer numbers from the input. The first integer is the height of Andy, and the second one is the height of his best friend Ben. Your program should print 'True' if Andy is taller than Ben or 'False' otherwise.

Sample Input 1:

150
160

Sample Output 1:

False

Sample Input 2:

170
165

Sample Output 2:

True
Write a program in Python 3
# To get input from the user, use the input function, which returns the entered value as a string.
# To convert this string to an integer, use the built-in int function.

andy_height = int(input())
ben_height = int(input())

# Now, write a comparison operation to check if Andy's height is greater than Ben's.
# Remember, the comparison operator should return a boolean value: True or False.

# Finally, print the result of the comparison operation.

Create a free account to access the full topic