How to Stop Current Iteration of While Loop in Python


In this example, we will learn how to stop the current iteration of the while loop and continue with the next in Python.

Source Code

a = 3
while a < 20:
    a += 4
    if a == 15:
        continue
    print(a)

Output:

7
11
19
23
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement