我在Windows PowerShell中使用Python 2.7。为什么这个while语句无限循环?
def loop(loop):
i = 0
numbers = []
while i < loop:
print "At the top i is %d" % i
numbers.append(i)
i += 1
print "Numbers now: ", numbers
print "At the bottom i is %d" % i
value = raw_input("Choose the loop value:\n>")
print value
loop(value)
当我输入6
作为输入为value
,loop()
变成无限循环。
任何想法是什么问题?
变化'WHI当我
2013-08-20 16:28:49
你确定吗?当我运行它时,它是有限的。 – enginefree
@Sp。凉!谢谢!但为什么? – hugleecool