只是想写一个程序来接受用户输入并将其添加到列表“数字”中:
print "Going to test my knowledge here"
print "Enter a number between 1 and 20:"
i = raw_input('>> ')
numbers = []
while 1 <= i <= 20 :
print "Ok adding %d to numbers set: " % i
numbers.append(i)
print "Okay the numbers set is now: " , numbers
但是,当我执行程序时,它只运行到 raw_input()
Going to test my knowledge here
Enter a number between 1 and 20:
>>> 4
我在这里缺少一些基本规则吗?