Python continue statement
The Python continue statement skips the current loop iteration, while break exits the entire loop.
The continue statement tells Python to skip the remaining statements in the current loop and continue with the next loop iteration.
The continue statement is used in while and for loops.
The syntax format of the continue statement in Python is as follows:
continue
Flowchart:

Example:
Example (Python 2.0+)
#!/usr/bin/python
# -*- coding: UTF-8 -*-
for letter in 'Python': # The first example
if letter == 'h':
continue
print 'Current letter :', letter
var = 10 # The second example
while var > 0:
var = var -1
if var == 5:
continue
print 'Current variable value :', var
print "Good bye!"
The execution result of the above example is:
当前字母 : P 当前字母 : y 当前字母 : t 当前字母 : o 当前字母 : n 当前变量值 : 9 当前变量值 : 8 当前变量值 : 7 当前变量值 : 6 当前变量值 : 4 当前变量值 : 3 当前变量值 : 2 当前变量值 : 1 当前变量值 : 0 Good bye!Other Extensions