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
🌐
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....
🌐
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   2 weeks 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
How continue works in while loop
name = 'Jesaa29 Roy' size = len(name) i = 0 while i More on discuss.python.org
🌐 discuss.python.org
0
0
October 18, 2022
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
April 26, 2024
(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
🌐
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.
Find elsewhere
🌐
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.
🌐
Python.org
discuss.python.org › python help
How continue works in while loop - Python Help - Discussions on Python.org
October 18, 2022 - name = 'Jesaa29 Roy' size = len(name) i = 0 while i < size: if name[i].isspace(): continue print(name[i], end=' ') i = i + 1 #it’s supposed to print name without space “Jessa29Roy”, but the output i…
🌐
Built In
builtin.com › software-engineering-perspectives › pass-vs-continue-python
Pass vs. Continue in Python Explained | Built In
Pass and continue are two statements in Python that alter the flow of a loop. Pass signals that there’s no code to execute, while continue forces the loop to skip the remaining code and start a new statement. Here’s what you need to know.
🌐
Reddit
reddit.com › r/learnpython › when should i use the 'continue' keyword?
r/learnpython on Reddit: When should I use the 'continue' keyword?
April 26, 2024 -

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?

🌐
Python documentation
docs.python.org › 3 › tutorial › controlflow.html
4. More Control Flow Tools — Python 3.14.3 documentation
If the loop finishes without executing the break, the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred.
🌐
Reddit
reddit.com › r/python › (over?)use of continue in for loops in python
r/Python on Reddit: (Over?)use of continue in for loops in python
November 17, 2021 -

Hi! I don't have much experience (around 3 years of not full-time programming) and was wondering what do you think about the use of 'continue' statement in for loops

In the project I'm working on there is a need to make a lot of validations.What usually happens we program using a lot of 'if' and 'elif' and 'else'So the indentations make the code wider than a Dubai highway...

What I thought about is calling methods for error controlling (logs the issue and returns False)and using continue for the next item in the loop

What do you think?

(Some colleagues tried to create different Classes for each of the validation but IMO it gets the code too twisted and practically impossible to debug - may work in a bigger project)

🌐
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, ...
🌐
W3Schools
w3schools.com › python › gloss_python_while_continue.asp
Python While Continue
Python Dictionaries Access Items ... Items Loop Dictionaries Copy Dictionaries Nested Dictionaries Dictionary Methods Dictionary Exercises Code Challenge Python If...Else · Python If Python Elif Python Else Shorthand If Logical Operators Nested If Pass Statement Code Challenge Python Match ... Python Functions Python Arguments Python *args / **kwargs Python Scope Python Decorators Python Lambda Python Recursion Python Generators Code Challenge Python Range ... Matplotlib Intro Matplotlib ...
🌐
Quora
quora.com › How-do-you-break-and-continue-a-loop-in-Python
How to break and continue a loop in Python - Quora
Answer (1 of 2): Thanks for the A2A Ridam Dhami. Break: The break statement, like in C, breaks out of the innermost enclosing for or while loop. If a for loop is terminated by break, the loop control target keeps its current value. eg. To find the smallest number that is divisible by both 3 ...
🌐
Team Treehouse
teamtreehouse.com › community › how-to-continue-loop-after-exception
How to continue loop after exception? (Example) | Treehouse Community
December 28, 2020 - import random GREETING = "======> Welcome to Rando <=====" def start_game(): print(GREETING.upper()) answer = random.randint(1,10) num_of_guess = 1 print(answer) rules = print("Select an integer between 1 & 10, and I will tell you if it's too high or too low. \n If you can\'t correctly guess my number within 3 tries, it\'s GAMEOVER!") try: while num_of_guess < 4: guess = int(input("Pick an integer between 1 & 10: ")) if 1 < guess > 10: raise ValueError #continue if guess == answer: print("Congrats!
🌐
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 ...
🌐
LearnDataSci
learndatasci.com › solutions › python-continue
Python Continue - Controlling for and while Loops – LearnDataSci
continue is used to skip the remainder of a loop when certain conditions are met. When called, continue will tell Python to skip the rest of the code in a loop and move on to the next iteration.
🌐
WsCube Tech
wscubetech.com › resources › python › continue-statement
Continue Statement in Python: Syntax, Uses, Examples
November 5, 2025 - Learn about the Python continue statement, its features, benefits, use cases, and examples. Enhance your code efficiency in this tutorial.