I understand how this construct works:
for i in range(10):
print(i)
if i == 9:
print(\"Too big - I\'m
To make it simple, you can think of it like that;
break
command in the for
loop, the else
part will not be called.break
command in the for
loop, the else
part will be called.In other words, if for loop iteration is not "broken" with break
, the else
part will be called.