import random #生成随机数
secret=random.randint(1,100)
print("猜数字游戏!1—100的整数,你最多可以猜9次")
tries=1
while tries<=9:
guess=int(input("1-100的整数,第%d次猜,请输入:"%(tries)))
if guess==secret:
print("答对,本轮游戏结束\n")
break
elif guess>secret:
print("大了")
tries += 1
else:
print("小了")
tries += 1
else:
print("机会已用完,答案是%d"%(secret))
11-08
1160
10-15
1万+
10-12
1149