Continue Statement in Python

Updated: May 18


The continue statement is used within a loop to skip the rest of the statements in the body of loop for the current iteration and jump to the start of the loop for next iteration. The break and continue statements are opposite each other which are used to change the flow of loop, break terminates the loop when a condition is got and continue leave out the current iteration.

Syntax:

continue

Flow diagram


Example:

program to display only odd numbers

for n in [10, 13, 9, 68, 4, 91, 54]:

if n%2 == 0:

continue

print(n)

Output:

13

9

91



Recent Posts

See All

Python Modules

A module is a file containing Python definitions and statements. A module can characterize functions, classes and variables. A module can likewise incorporate runnable code. Gathering related code int

Command Line Arguments in Python

Command Line Arguments are the arguments that are specified after the name of the program in the command line shell of the operating system. Python gives different ways of dealing with these types of