python-by-example-150-chall.../challenges52-59/challenge-055.py

16 lines
359 B
Python
Raw Permalink Normal View History

2019-07-18 17:44:06 +08:00
import random
choose = random.randint(1, 5)
ask = int(input('Choose number from (1-5) against computer! : '))
if choose > ask:
print('Too low')
elif choose < ask:
print('Too high')
else:
print('Well done')
ask = int(input('Choose second number from (1-5) against computer! : '))
if choose == ask:
print('Correct')
else:
print('You lose')