【发布时间】:2012-11-10 01:39:53
【问题描述】:
我有一个 for 语句提示用户输入 5 个数字。像这样:
"Input 1. number:
input 2. number:
..
..
.."
我想重复用户在输入错误之前得到的最后一个提示(数字太大)。 但是我的程序跳过了错误的:
喜欢这个
"Input 1. number:
5
Accepted
input 2. number:
999
Wrong! Retry
(here I use *continue* for the loop)
input 3.number:
---"
我应该怎么做才能重新问第二个问题?
【问题讨论】:
-
你能发布你当前的代码吗?
标签: python loops for-loop while-loop