Python: for-else with break
The
else
clause executes when the loop completes normally. This means that the loop did not encounter anybreak
.
In addition, if an exception is raised in for
without handling, else
after this for
won’t execute.
The
else
clause executes when the loop completes normally. This means that the loop did not encounter anybreak
.
In addition, if an exception is raised in for
without handling, else
after this for
won’t execute.
Comments