Python: for-else with break
The
elseclause 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
elseclause 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.
留下评论