The Python continue statement jumps out of the loop, and break jumps out of the loop.
The continue statement is used to tell Python to skip the remaining statements of the current loop, and then proceed to the next round of loops.
The continue statement is used in the while and for loops.
The Python language continue statement syntax is formatted as follows:
Continue
Flow chart:
Instance:
#!/usr/bin/python for the ' Python ': # First Example if letter = = ' h ': continue print ' current Lette R: ', letter var = ten # Second examplewhile var > 0: var = var-1 If var = = 5: continue print ' Curr ENT variable value: ', varprint "good bye!"
The result of the above instance execution:
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!