Primary
break ⚬ᵖʸ|Documentation|1st|20251021160556-00-⌔
7. Simple statements — Python 3 documentation#the-break-statement
7.9. The
breakstatementbreak_stmt: "break"
breakmay only occur syntactically nested in afororwhileloop, but not nested in a function or class definition within that loop.It terminates the nearest enclosing loop, skipping the optional
elseclause if the loop has one.If a
forloop is terminated bybreak, the loop control target keeps its current value.When
breakpasses control out of atrystatement with afinallyclause, thatfinallyclause is executed before really leaving the loop.Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •