Behavior of the for-else construct

Chris Angelico rosuav at gmail.com
Fri Mar 4 16:01:36 EST 2022


On Sat, 5 Mar 2022 at 07:52, Avi Gross <avigross at verizon.net> wrote:
>
> Chris,
>
> My example was precisely what to do when it is an empty closet:

Does it correctly handle a closet with shirts in it, though?

There's not a lot of point demonstrating an alternate use for the
"else" clause when it is *absolutely identical* to simply placing two
loops one after another.

ChrisA


More information about the Python-list mailing list