我在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