[Solved] Construct a game so that two random numbers appear and the user has to choose which one is bigger

[ad_1]

The simplest thing you can do is ask for the value of the biggest number, and compare it to the biggest number:

biggest = max(a1, a2)

user_num = int(input("What is the biggest number?"))

if user_num == biggest:
    print('Correct!')
else:
    print('Wrong! The biggest number is {}'.format(biggest))

Note the use of int() for converting the input to integer before testing for equality.

1

[ad_2]

solved Construct a game so that two random numbers appear and the user has to choose which one is bigger