The else
clause of a loop is skipped when a break
is executed in this loop. In other words, a loop with an
else
but no break
statement will always execute the else
part (unless of course an exception is raised or
return
is used). If this is what the developer intended, it would be much simpler to have the else
statement removed and its
body unindented. Thus having a loop with an else
and no break
is most likely an error.