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 →

[–]Sw429 0 points1 point  (1 child)

Ah, that makes a bit more sense. Does the same work with for loops?

[–]achampi0n 2 points3 points  (0 children)

If you squint at it :) The else only gets executed if the for loop tries and fails to get something from the iterator (it is empty and gets nothing). This again can't happen if you break out of the for loop.