Following is the code I'm executing in IDLE for Python 3.5.2 on Windows 10:
spam = 0
while spam < 5:
print('Hello, world.')
spam = spam + 1
I can see Hello World printed 5 times however when entering spam in IDLE, I can see the integer 5. Shouldn't this be logically int 6 since while loop will stop as soon as the spam is incremented by 1 from 5 and spam variable is passed with the incremented int?
Thank you!
spamis 5, why do you think it would print 6?