[問題] 自學新手的一個問題
number = 23
running = True
while running:
guess = int(raw_input('Enter an integer : '))
if guess == number:
print 'Congratulations, you guessed it.'
running = False # this causes the while loop to stop
elif guess < number:
print 'No, it is higher than that.'
else:
print 'No, it is lower than that.'
else:
print 'The while loop is over'
print 'Done'
請問 在running = False # this causes the while loop to stop
這邊會讓迴圈停止 為什麼啊??
麻煩各位高手為小弟解惑 順便一問PYTHON 的學習手冊有二手或那裡租的到嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.45.87.106
→
01/22 22:41, , 1F
01/22 22:41, 1F
→
01/23 23:39, , 2F
01/23 23:39, 2F
→
01/24 11:42, , 3F
01/24 11:42, 3F