Asked By – JohnG
The definition of the
continue statement is:
continuestatement continues with the next iteration of the loop.
I can’t find any good examples of code.
Could someone suggest some simple cases where
continue is necessary?
Now we will see solution for issue: Example use of “continue” statement in Python?
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: