- 2
Why 5 doesn't show up?
Why 5 doesn't show up and it shows finished instead
3 Answers
+ 2
helps if we can see your code to give answers, but consider this..
run=0
while run<5:
print(run)
run=run+1 #------ This line is after print
that outputs 0 1 2 3 4
run=0
while run<5:
run=run+1 #------ This line is before print
print(run)
that outputs 1 2 3 4 5
+ 1
the first one prints and then increases run. the second one increases run and then prints
0
Thanks but what is the difference between the two examples you wrote