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.
blog comments powered by Disqus