[Tutor] for -- else: what was the motivation?

Sibylle Koczian nulla.epistola at web.de
Sun Oct 9 06:49:50 EDT 2022


Am 08.10.2022 um 06:13 schrieb Dan Stromberg:
> The else is executed if you don't "break" out of the loop early.
>
> It cuts down on boolean flags.
>

Which means that "for -- else" can't be useful for a loop without a
"break" in it - and the OP's examples didn't have breaks.




More information about the Tutor mailing list