On 5/14/26 01:32, Left Right via Python-list wrote:

> [...] "else" is
> allowed in "strange" places in Python, eg.
>
>      for var in iterator:
>      else:
>          statement
>
> with the intention of executing the "statement" when the loop exits
> early.

Not sure what you mean by "exits early", but the `else` statement will run 
unless `break`
is encountered in the `for` loop.

--
~Ethan~
--
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to