Here's a simple example:

for letter in 'Django':    
    if letter == 'D':
        continue
    print("Current Letter: " + letter)

Output will be:

Current Letter: j
Current Letter: a
Current Letter: n
Current Letter: g
Current Letter: o

It skips the rest of the current iteration (here: print) and continues to the next iteration of the loop.

Answer from Snehal Parmar on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-continue-statement
Python Continue Statement - GeeksforGeeks
Explanation: Whenever char == 'e', the continue statement executes, skipping the print function for that iteration. Example 2. Using continue in nested loops
Published   1 week ago
Discussions

Can't understand "Continue" function in Python statement(for loop, while loop) !!
It jumps directly to the next iteration of a loop. In the code below the continue function skips the print statement below it so that "odd" is only printed on odd numbers. for i in range(10): if i%2==0: print("even") continue print("odd") More on reddit.com
🌐 r/learnpython
20
44
November 9, 2019
(Over?)use of continue in for loops in python
I don't see any issue with a standard pattern like: for rec in records: if is_invalid(rec): continue process(rec) I would caution against burying continues in the middle of a body of code as people wouldn't be expecting them, or against having multiple continues, but otherwise it is fine. You might also consider things like filter or itertools.filterfalse as an alternative. More on reddit.com
🌐 r/Python
30
28
November 17, 2021
Example to understand use of 'break' and 'continue' in loops.
While in a loop, break terminates the loop execution and continues to the next instruction. continue, on the other hand, instructs the loop to begin the next iteration immediately. Say you had a loop like this: a = True counter = 0 while True: counter += 1 if a == True: print("Ending loop!") break if counter % 2 != 0: continue print(counter) print("Got out of the loop!") If you were to run this code, you'd get Ending loop! Got out of the loop! And if a had any other value, you'd just get an infinite loop printing even numbers. As I said, break terminates the loop that is currently in scope. It raises an error if you use it without being in a loop. This is why also the code below the loop is executed. The continue essentially skips everything inside the loop before it and starts over from the top. More on reddit.com
🌐 r/learnpython
21
9
July 2, 2017
When should I use the 'continue' keyword?
Continue is a fairly clean way to skip the rest of the loop code for that element. For example you might have a situation like the following: for element in elements: if element == unusable_edge_case: continue # skip this element if element == problematic: if element == fixable: do-fix-here # apply fix, element is now compatible with the 30-lines-of-code below else: continue # skip this element do 30-lines-of-code here You can rewrite this with nested if/else logic, but it is not pretty and the overall intention will not be as easy to read. You might even mess up the exact nesting logic for if/else. Edit: Reworded the ...lines-of-code... placeholder names. More on reddit.com
🌐 r/learnpython
51
7
December 25, 2023
🌐
Programiz
programiz.com › python-programming › break-continue
Python break and continue (With Examples)
For example, # Program to print odd numbers from 1 to 10 num = 0 while num < 10: num += 1 if (num % 2) == 0: continue print(num) ... In the above example, we have used the while loop to print the odd numbers between 1 and 10. Here, ... Before we wrap up, let’s put your knowledge of Python ...
🌐
W3Schools
w3schools.com › python › ref_keyword_continue.asp
Python continue Keyword
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... The continue keyword is used to end the current iteration in a for loop (or a while loop), and continues to the next iteration.
🌐
Tutorialspoint
tutorialspoint.com › python › python_continue_statement.htm
Python - Continue Statement
num = 60 print ("Prime factors for: ", num) d=2 while num > 1: if num%d==0: print (d) num=num/d continue d=d+1
🌐
Real Python
realpython.com › python-continue
Skip Ahead in Loops With Python's continue Keyword – Real Python
March 27, 2025 - Assume you have the following for loop that computes the sum of all numbers in a list: ... This works fine, but what if you want to add only the positive numbers, ignoring all the negative ones? You can modify this loop to add only positive numbers using continue: ... In this case, since Python executes continue only when the number is less than zero, it doesn’t add those numbers to total.
🌐
W3Schools
w3schools.com › python › gloss_python_for_continue.asp
Python Continue For Loop
With the continue statement we can stop the current iteration of the loop, and continue with the next: ... fruits = ["apple", "banana", "cherry"] for x in fruits: if x == "banana": continue print(x) Try it Yourself »
Find elsewhere
🌐
W3Schools
w3schools.com › python › python_for_loops.asp
Python For Loops
Exit the loop when x is "banana", but this time the break comes before the print: fruits = ["apple", "banana", "cherry"] for x in fruits: if x == "banana": break print(x) Try it Yourself » · With the continue statement we can stop the current iteration of the loop, and continue with the next:
🌐
Tutorialspoint
tutorialspoint.com › python › python_loop_control.htm
Python Break, Continue and Pass Statements
The continue statement can be used in both while and for loops. for letter in 'Python': # First Example if letter == 'h': continue print ('Current Letter :', letter) var = 10 # Second Example while var > 0: var = var -1 if var == 5: continue ...
🌐
Python documentation
docs.python.org › 3 › tutorial › controlflow.html
4. More Control Flow Tools — Python 3.14.3 documentation
For example (no pun intended): >>> # Measure some strings: >>> words = ['cat', 'window', 'defenestrate'] >>> for w in words: ... print(w, len(w)) ... cat 3 window 6 defenestrate 12 · Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection:
🌐
LearnDataSci
learndatasci.com › solutions › python-continue
Python Continue - Controlling for and while Loops – LearnDataSci
When called, continue will tell Python to skip the rest of the code in a loop and move on to the next iteration. To demonstrate, let's look at how we could use continue to print out multiples of seven between one and fifty. Notice how the print() statement is skipped when the if statement is ...
🌐
CodeSignal
codesignal.com › learn › courses › exploring-iterations-and-loops-in-python › lessons › mastering-loop-controls-break-and-continue-in-python
Mastering Loop Controls: Else, Break and Continue in Python
In this example, the continue statement skips the rest of the loop body for items that are already packed, allowing the loop to only print out the items that still need to be packed. This way, we efficiently focus on what is left to be packed without unnecessary checks or reminders for already ...
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python for loop continue and break
Python For Loop Continue And Break - Spark By {Examples}
April 17, 2024 - The example is given below. If the break statement is inside a nested loop, the break statement will end the innermost loop and the outer loop continue executing. ... # Using break statement inside the nested loop ourses1=["java","python"] ...
🌐
Python Tutorial
pythontutorial.net › home › python basics › python continue
Using Python continue Statement to Control the Loops
March 26, 2025 - for index in range(n): if condition: continue # more code hereCode language: Python (python) And the following illustrates how to use the continue statement in a while loop: while condition1: if condition2: continue # more code hereCode language: Python (python) The following example shows how to use the for loop to display even numbers from 0 to 9:
🌐
Built In
builtin.com › software-engineering-perspectives › pass-vs-continue-python
Pass vs. Continue in Python Explained | Built In
More on Python: 3 Ways to Write Pythonic Conditional Statements · The continue statement is used to skip the remaining code inside a loop for the current iteration only. For instance, let’s use continue instead of a break statement in the previous example.
🌐
Boot.dev
boot.dev › lessons › 3f2e485c-fcc2-419c-8664-f4b6318b4c7f
Learn to Code in Python: Continue Statement | Boot.dev
continue means "go directly to the next iteration of this loop." Whatever else was supposed to happen in the current iteration is skipped. Let's say we want to print all the numbers from 1 to 50, but skip every 7th number.
🌐
GeeksforGeeks
geeksforgeeks.org › python › loops-in-python
Loops in Python - GeeksforGeeks
Explanation: The continue statement is used to skip the current iteration of a loop and move to the next iteration. It is useful when we want to bypass certain conditions without terminating the loop. The break statement in Python brings control out of the loop. ... for letter in 'geeksforgeeks': if letter == 'e' or letter == 's': break print('Current Letter :', letter)
Published   4 days ago
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-use-break-continue-and-pass-statements-when-working-with-loops-in-python-3
How to Break Out of Multiple Loops in Python | DigitalOcean
August 7, 2025 - This article provides a comprehensive guide to using Python’s break, continue, and pass statements within loops to control flow effectively. It explains the purpose and behavior of each statement with practical code examples and output demonstrations. The article also explores advanced loop control techniques, including methods for ...
🌐
Learn Python
learnpython.dev › 02-introduction-to-python › 110-control-statements-looping › 40-break-continue
break, continue, and return :: Learn Python by Nina Zakharenko
break and continue allow you to control the flow of your loops. They’re a concept that beginners to Python tend to misunderstand, so pay careful attention. The break statement will completely break out of the current loop, meaning it won’t run any more of the statements contained inside of it. >>> names = ["Rose", "Max", "Nina", "Phillip"] >>> for name in names: ...