PEP 284, Integer for-loops

David Eppstein eppstein at ics.uci.edu
Wed Mar 6 19:57:03 EST 2002


In article <slrna8dedk.utc.grey at teleute.dmiyu.org>,
 Steve Lamb <grey at despair.dmiyu.org> wrote:

> Fine, don't like range(n-1,-1,-1) and don't feel like taking the <60s to
> look it up?  I give you:
> 
> foo = range(n-1,0)
> foo.reverse()
> for x in foo:
>     do_whatcha_like(x)
> 
>     Still too obtuse for you?

I think you have made my point for me, that range is hard to use 
correctly.  Did you try running range(n-1,0)?  What list did it give you?



More information about the Python-list mailing list