【发布时间】:2021-10-28 11:35:30
【问题描述】:
answer = 5
guess = int(input('Please make a wild number guess: '))
count = 1
while guess != answer:
count += 1
int(input('wrong. Please make another guess: '))
print(f"this is your {count} attempt")
if guess == answer:
break
print('Correct!!!')
我在输入 5 后没有得到预期的答案。在输入正确答案后,我仍然卡在 while 循环中。
错了。请再猜一猜:5 这是你的第 6 次尝试
【问题讨论】:
标签: python while-loop break