user_image
By  MANCHESTERfcc    On   2019年10月15日 15:54

number = 20 guess = -1 print("数字猜谜游戏!") while guess != number: x = input("请输入你猜的数字:") # guess = int(input("请输入你猜的数字:")) if x.isdecimal(): guess = int(x) if guess == number: print("恭喜,你猜对了!") elif guess < number: print("猜的数字小了...") elif guess > number: print("猜的数字大了...") else: print('输入不合法,请输入数字')