while Loops

Elizabeth Weiss cake240 at gmail.com
Tue Jun 21 23:50:24 EDT 2016


i=1
while i<=5:
   print(i)
   i=i+1

The result is:
1
2
3
4
5

Why is one of the results 5 since i=i+1? Should the maximum result be 4 since 4 +1=5? 

Thanks for your help!


More information about the Python-list mailing list