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
The continue statement in Python is a loop control statement that skips the rest of the code inside the loop for the current iteration and moves to the next iteration immediately.
Published   1 week ago
🌐
W3Schools
w3schools.com › python › ref_keyword_continue.asp
Python continue Keyword
Python Examples Python Compiler ... 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....
Discussions

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
python - What does the continue statement do? - Stack Overflow
continue continues with the next ... use the statement. ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... New site design and philosophy for Stack Overflow: Starting February 24, 2026... I’m Jody, the Chief Product and Technology Officer at Stack Overflow. Let’s... -5 Python code goes in infinite for simple number printing · 187 Example use of "continue" statement ... More on stackoverflow.com
🌐 stackoverflow.com
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
People also ask

How does the continue statement work in Python?
When a program encounters a Python continue statement in code, it skips the current iteration and moves on to the next one. This is useful when we want to exclude certain iterations depending on given conditions.
🌐
wscubetech.com
wscubetech.com › resources › python › continue-statement
Continue Statement in Python: Syntax, Uses, Examples
Why do we need the continue statement in Python?
The continue statement in Python skips the rest of the statements in the current iteration of the loop and gives control to the top of the loop. Basically, it returns control to the beginning of the loop. We use the continue statement with the while and for loops.
🌐
wscubetech.com
wscubetech.com › resources › python › continue-statement
Continue Statement in Python: Syntax, Uses, Examples
What is the use of continue in Python?
If we want to skip part of a loop based on a condition but continue running the rest of the loop, the continue statement helps us do that without stopping the loop entirely.
🌐
wscubetech.com
wscubetech.com › resources › python › continue-statement
Continue Statement in Python: Syntax, Uses, Examples
🌐
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 ...
🌐
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.
🌐
WsCube Tech
wscubetech.com › resources › python › continue-statement
Continue Statement in Python: Syntax, Uses, Examples
October 1, 2025 - Learn about the Python continue statement, its features, benefits, use cases, and examples. Enhance your code efficiency in this tutorial.
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › when should i use the 'continue' keyword?
r/learnpython on Reddit: When should I use the 'continue' keyword?
December 25, 2023 -

So, I tried searching the group and I found people asking *what* the continue keyword does, which is not my question. I think I understand it. Basically, it just says "hey, if x condition is met do not do what you did to every other element in the loop. Potentially do this instead or Just go to the next item."

The question I have is why should I use it instead of just an if-esle statement,, or if you prefer continue why should I use an if-else and not default to continue.

To put it into context, what is the meaningful difference between the following code blocks:

for i in range(10):
if i == 7:
    print('7? I hate prime numbers bigger than 5!')
    continue
print(f'Woo! I love the number {i}')

and

for i in range(10):
if i == 7:
    print('7? I hate prime numbers bigger than 5!')
else:
    print(f'Woo! I love the number {i}')

Both got me the same result. Is it just a "Python has many ways to do the same thing" deal or am I missing a crucial difference?

🌐
Built In
builtin.com › software-engineering-perspectives › pass-vs-continue-python
Pass vs. Continue in Python Explained | Built In
Pass: The pass statement in Python ... code. Continue: The continue statement in Python is used to skip the remaining code inside a loop for the current iteration only...
🌐
Boot.dev
boot.dev › lessons › 3f2e485c-fcc2-419c-8664-f4b6318b4c7f
Learn to Code in Python: Continue Statement | Boot.dev
Python (like many programming languages) provides a way to do this: the continue statement. continue means "go directly to the next iteration of this loop." Whatever else was supposed to happen in the current iteration is skipped.
🌐
Real Python
realpython.com › python-continue
Skip Ahead in Loops With Python's continue Keyword – Real Python
March 27, 2025 - Test your understanding of Python's continue keyword, which allows you to skip code in a loop for the current iteration and jump immediately to the next one. Loops are control flow statements used to perform operations repeatedly a certain number ...
🌐
Unstop
unstop.com › home › blog › continue statement in python | working explained with examples
Continue Statement In Python | Working Explained With Examples
February 4, 2025 - The continue statement in Python programming is used inside loops to skip the current iteration and proceed directly to the next iteration of the loop. When the continue statement is encountered, the remaining code in that iteration is ignored, ...
🌐
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.
Published   4 days ago
🌐
Learn By Example
learnbyexample.org › python-continue-statement
Python Continue Statement - Learn By Example
April 20, 2020 - # in a for Statement for x in range(2): try: print('trying...') continue print('still trying...') except: print('Something went wrong.') finally: print('Done!') print('Loop ended.') # Prints trying... # Prints Done! # Prints trying... # Prints Done!
🌐
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 ...
🌐
AskPython
askpython.com › home › python continue statement
Python continue Statement - AskPython
July 7, 2022 - Python continue statement is used to skip the execution of the current iteration of the loop. We can’t use continue statement outside the loop, it will throw an error as “SyntaxError: ‘continue’ outside loop“. We can use continue statement ...
🌐
Geek University
geek-university.com › home › the continue statement
The continue statement | Python# - Geek University
February 1, 2022 - The continue statement in Python is used to skip the rest of the code inside a loop for the current iteration only. In other words, the loop will not terminate immediately but it will continue on with the next iteration.
🌐
Quora
quora.com › What-is-the-purpose-of-the-continue-and-break-statements-in-a-loop-in-Python
What is the purpose of the 'continue' and 'break' statements in a loop in Python? - Quora
The continue statement is used to skip the current iteration of the loop and the control flow of the program goes to the next iteration. ... Freelance Project Manager for your web projects.
🌐
Python Tutorial
pythontutorial.net › home › python basics › python continue
Using Python continue Statement to Control the Loops
March 26, 2025 - The following shows how to use the continue statement in a for loop: for index in range(n): if condition: continue # more code hereCode language: Python (python)