for / while else doesn't make sense

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Thu Jun 2 22:47:32 EDT 2016


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. And that is iterating over a fixed set of values. E.g. in Python

    for rendering in (False, True) :
        ...
    #end for

versus the (slightly) more long-winded C:

    for (bool rendering = false;;)
      {
        ...
        if (rendering)
            break;
        rendering = true;
      } /*for*/



More information about the Python-list mailing list