r/PythonLearning • • Jul 11 '25

Code won't print

Post image

What's the error?(I'm a newbie)

115 Upvotes

86 comments sorted by

View all comments

1

u/SergeantSemantics66 Jul 12 '25

When i is even, it hits continue before it can reach print(i) or the second i += So it skips printing the even numbers — which is fine. But you already increment i before the continue, so that’s fine too. But if you didn’t increment i before continue, it would get stuck in an infinite loop.