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
🌐
Programiz
programiz.com › python-programming › break-continue
Python break and continue (With Examples)
We can also terminate the while loop using the break statement. For example, i = 0 while i < 5: if i == 3: break print(i) i += 1 ... The continue statement skips the current iteration of the loop and the control flow of the program goes to the next iteration.
🌐
Real Python
realpython.com › python-continue
Skip Ahead in Loops With Python's continue Keyword – Real Python
March 27, 2025 - In a while loop, continue transfers control back to the condition at the top of the loop. If that condition is True, then the loop body will run again. If it’s False, then the loop ends. Consider the following while loop. It leverages Python’s walrus operator to get user input, casts it to an int, and adds the number to a running total.
🌐
Tutorialspoint
tutorialspoint.com › python › python_continue_statement.htm
Python - Continue Statement
Python continue statement is used to skip the execution of the program block and returns the control to the beginning of the current loop to start the next iteration. When encountered, the loop starts next iteration without executing the remaining
🌐
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), ...
🌐
W3Schools
w3schools.com › python › gloss_python_for_continue.asp
Python Continue For Loop
fruits = ["apple", "banana", "cherry"] for x in fruits: if x == "banana": continue print(x) Try it Yourself » · Python For Loops Tutorial For Loop Through a String For Break Looping Through a Range For Else Nested Loops For pass
🌐
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:
Find elsewhere
🌐
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 ...
🌐
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 ...
🌐
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:
🌐
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.
🌐
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.
🌐
Accuweb
accuweb.cloud › home › python break, continue, pass statements with examples
Python Break, Continue, Pass Statements with Examples
December 11, 2023 - Once the break statement runs, Python exits the loop and continues executing the code that appears after the loop. This is useful when you want to stop searching or processing once a condition has been satisfied. ... count = 0 while count < 5: print("Iteration:", count) if count == 2: break count += 1 Output Iteration: 0 Iteration: 1 Iteration: 2Copy · In this example, the loop normally would run five times.
🌐
Python Tutorial
pythontutorial.net › home › python basics › python continue
Using Python continue Statement to Control the Loops
March 26, 2025 - How it works. First, iterate over a range of numbers from 0 to 9 using a for loop with the range() function. Second, if the index is an odd number, skip the current iteration and start a new one. Note that the index % 2 returns 1 if the index is an odd number and 0 if the index is an even number.
🌐
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 - Understanding and utilizing these ... 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 demonstration...
🌐
Unstop
unstop.com › home › blog › python break and continue statements explained with examples
Python Break And Continue Statements Explained With Examples
October 18, 2024 - For Example- for number in [1, 2, 3, 4, 5]: if number == 3: print("Found 3, exiting loop") break · Skipping unwanted iterations: Use Python continue statement when you want to skip certain iterations based on a condition without ending the loop.
🌐
LearnDataSci
learndatasci.com › solutions › python-continue
Python Continue - Controlling for and while Loops – LearnDataSci
As mentioned previously, continue is used to skip to the end of the current iteration of a loop. Therefore, Python will only bypass code in situations that trigger continue. For a more complex example, let's say we'd like to iterate through a list of numbers and find the square root of each number in the list.
🌐
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"] ...
🌐
Real Python
realpython.com › python-while-loop
Python while Loops: Repeating Tasks Conditionally – Real Python
March 3, 2025 - In this tutorial, you'll learn about indefinite iteration using the Python while loop. You'll be able to construct basic and complex while loops, interrupt loop execution with break and continue, use the else clause with a while loop, and deal with infinite loops.