for / while else doesn't make sense

Lawrence D’Oliveiro lawrencedo99 at
Fri Jun 3 12:22:11 EDT 2016

On Friday, June 3, 2016 at 9:33:32 PM UTC+12, BartC wrote:
> On 03/06/2016 03:47, Lawrence D’Oliveiro wrote:
>> On Friday, June 3, 2016 at 8:52:52 AM UTC+12, BartC wrote:
>>> Simple iterative for-loops are more of a DIY effort...
>> There is one case that Python handles more nicely than C.
> Just one case? Python is miles away from a C 'for'.

Yes, just one case. In Python you write a loop with one exit in one way, a loop with two exits in a different way, and a loop with more than two exits in yet another entirely different way. Can you say “cognitive burden”?

The for-statement in C handles most of my looping requirements. I rarely use while-loops, and do-whiles almost not at all--not for looping, anyway

More information about the Python-list mailing list