Home >>Python Keywords >Python continue Keyword

Python continue Keyword

Python continue Keyword

Python continue Keyword is used to finish the present ongoing iteration during a for loop or a while loop and continues to the next iteration of the given loop.

Here is an example of Python continue keyword:

for i in range(9):
sif i <= 3:
continue
print(i)

Output:
4
5
6
7
8
Example 2:

i = 0
while i < 9:
i += 1
if i == 3:
continue
print(i)

Output:
1
2
4
5
6
7
8
9