Control Statement Notes
Control Statement Notes
Example – continue
for i in range(1,20):
if i % 6 == 0:
continue
print(i, end = „ „)
print(“Loop Over”)
The above code produces output
1 2 3 4 5 7 8 9 10 11 13 14 15 16 17 19
Loop Over
when the value of i becomes divisible from 6, condition
will becomes True and loop will skip all the statement
below continue and continues in loop with next value of
iteration.
while condition:
while condition:
Statement1
Statement2