4 ms·
From Python docs (https://docs.python.org/3/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops https://docs.python.org/3/tutorial
by asicsp 5y ago
From Python docs (https://docs.python.org/3/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops https://docs.python.org/3/tutorial/controlflow.html#break-an...):
>When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs.