The continue Statement in Loops in Python


Skip the rest of the current loop iteration and continue with the next one.

Source Code

for i in range(10):
    if i % 2 == 0:
        continue  # Skip even numbers
    print(i)  # This will print only odd numbers
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments