'''
功能:猜数游戏
作者:
日期:
'''
import random
while True:
target = random.randint(0,100)
x = int(input('Try to guess the number I am think of:'))
while True:
if x > target:
x = int (input('Too higt! Guess again:'))
elif x < target:
x = int (input('Too low! Guess again:'))
else:
break
choice = input('That is it! Would you like play again?(yes/no)')
if choice == 'no':
break
print('Thanks for playing.')
猜数游戏循环版
最新推荐文章于 2025-05-09 11:09:19 发布