StudyToCert

All certifications / PCEP / Lessons

PCEP – Certified Entry-Level Python Programmer PCEP-30-02 · Domain 2: Control flow: conditional blocks and loops

Break and continue, and how break affects only the innermost loop

▶ Watch the overview video

Last reviewed September 30, 2026 · Leer en español

Normally a loop runs its whole body on every iteration and stops only when its condition fails or its sequence runs out. Two keywords let you change that from inside the body. break ends the loop immediately; execution jumps to the first statement after the loop. continue ends only the current iteration; the rest of the body is skipped and the loop moves on to its next iteration. Neither keyword takes an argument. For a while loop that means re-checking the condition; for a for loop it means taking the next item.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 7 more sections, 5 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study PCEP for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the PCEP study plan