0
I don't understand the continue statement in while loops. How does it work?
3 Antworten
+ 4
continue stops the current iteration of the loop at the continue statement and jumps to the next iteration of the loop.
x = 0
while x < 10:
x += 1
if x % 2 == 0:
continue
print(x)
here if x is an even number then then print statement is skipped and the loop jumps to the next iteration.
0
thanks a lot guys