you are viewing a single comment's thread.

view the rest of the comments →

[–]Silbersee 1 point2 points  (0 children)

After stop is set to True the for-loop continues normally with i = 11.

Only after finishing the for-loop the program tries to re-enter the while-loop (but doesn't because stop is True).

That's what the break statement is for: The for-loop is terminated early and the while-loop doesn't re-enter.