i = 1
while i <= 3:
temp = input('猜猜我现在想的哪个数字:\n')
guess = int(temp)
if guess == 8:
print('恭喜你,你在猜第' + str(i) + '次时猜对啦!')
print('游戏结束,不玩啦^_^')
break
else:
if guess > 8:
print('你猜大了')
else:
print('你猜小了')
i += 1
else:
print('你的次数用完啦,不能继续猜啦!')
转载请注明原文地址:https://ipadbbs.8miu.com/read-21043.html