- 2

Why 5 doesn't show up?

Why 5 doesn't show up and it shows finished instead

11th Feb 2017, 1:59 AM
Ahmed Hassan
Ahmed Hassan - avatar
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
11th Feb 2017, 2:16 AM
LordHill
LordHill - avatar
+ 1
the first one prints and then increases run. the second one increases run and then prints
11th Feb 2017, 11:22 PM
LordHill
LordHill - avatar
0
Thanks but what is the difference between the two examples you wrote
11th Feb 2017, 11:14 PM
Ahmed Hassan
Ahmed Hassan - avatar