while

With the while loop we can execute a set of statements as long as a condition is true.


while expression: 
   statement (s)


i = 1 
while i < 6:
print(i)
i += 1


Exit The Loop



continue Statement

With the continue statement we can stop the current iteration, and continue with the next:


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


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext