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

12 lines
293 B
Python
Raw Normal View History

2019-07-18 17:44:06 +08:00
import random
choose = random.randint(1, 10)
ask = 0
while choose != ask:
ask = int(input('Choose number from (1-10) to guess computer number ! : '))
if choose > ask:
print('Too low')
elif choose < ask:
print('Too high')
print('Correct number {0}'.format(choose))