Описание тега continue
A language construct typically used to bypass the rest of a loop and return to the beginning for the next iteration.
Using continue
will go back to the first line of the loop, in this example when i
is 2
or 3
the program will immediately go back to the first line: for i in range(1, 6)
before the current iteration has finished
Example (Python):
for i in range(1, 6):
print(i)
if i == 2 or i == 3:
continue
print("do stuff")
print("after the loop")
Output:
1
do stuff
2
3
4
do stuff
5
do stuff
after the loop
Also see loops.