Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Python continue statement - Tutorialspoint

The Python continue statement is used to skip the remaining statements in the current iteration of a loop and return control to the beginning of the loop. It can be utilized in both while and for loops, as demonstrated in provided examples. The document includes syntax, flow diagrams, and sample code illustrating its functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Python continue statement - Tutorialspoint

The Python continue statement is used to skip the remaining statements in the current iteration of a loop and return control to the beginning of the loop. It can be utilized in both while and for loops, as demonstrated in provided examples. The document includes syntax, flow diagrams, and sample code illustrating its functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1/9/2021 Python continue statement - Tutorialspoint

Python continue statement

It returns the control to the beginning of the while loop.. The continue statement rejects all the
remaining statements in the current iteration of the loop and moves the control back to the top of
the loop.
The continue statement can be used in both while and for loops.

Syntax

continue

Flow Diagram

Example

Live Demo
#!/usr/bin/python

for letter in 'Python': # First Example


if letter == 'h':
continue
print 'Current Letter :', letter
https://www.tutorialspoint.com/python/python_continue_statement.htm 1/2
1/9/2021 Python continue statement - Tutorialspoint

var = 10 # Second Example


while var > 0:
var = var -1
if var == 5:
continue
print 'Current variable value :', var
print "Good bye!"

When the above code is executed, it produces the following result −

Current Letter : P
Current Letter : y
Current Letter : t
Current Letter : o
Current Letter : n
Current variable value : 9
Current variable value : 8
Current variable value : 7
Current variable value : 6
Current variable value : 4
Current variable value : 3
Current variable value : 2
Current variable value : 1
Current variable value : 0
Good bye!

https://www.tutorialspoint.com/python/python_continue_statement.htm 2/2

You might also like