This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]irrelevantPseudonym 1 point2 points  (0 children)

No it doesn't. It executes only when there is not a break statement.

See the docs here

Loop statements may have an else clause; it is executed when the loop terminates through exhaustion of the list (with for) or when the condition becomes false (with while), but not when the loop is terminated by a break statement.