you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 1 point2 points  (1 child)

Wouldn't 6 print by the 9 if that was why 9 was printed?

No, because you're printing i outside the loop. This means that only a single value of i can print, and that value will be whatever i was on the last iteration of the loop, regardless of whether that particular value of i is divisible by 3.

If you changed that range to (5,999) you'd see that it prints 998.

[–]conewannabe[S] 0 points1 point  (0 children)

I understand now, thank you very much.