Breaking out of a loop or continuing it under certain conditions (Python)

Solution 1:

the keyword continue will take you back to the next iteration without finishing the current one, example.

for i in range(5):
if i == 2:
    continue
print(i * 5)

This means that when i is 2 it wont print(i=2 * 5), instead it will go up to start the next loop where i=3. The output will be 0 5 15 20

If you use break, it will just completely stop and exit out of the iteration once it reaches this keyword. I think you're looking for the keyword pass.