Optional: good to know Step 3 of 16 on the Python Developer roadmap

break and continue

break leaves a loop early and continue jumps straight to the next round. They keep loops short when you have found what you need or want to skip bad data.

More in Decisions and loops

See it on the Python Developer roadmap