Arithmetic sequences in Python

Alex Martelli aleax at mail.comcast.net
Mon Jan 16 11:30:45 EST 2006


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:
   ...
> while the traditional
> 
>   xrange(f(n)-1, -1, -1)
> 
> only evaluates it once but is IMO repulsive.

Yep, reversed(range(f(n))) is MUCH better.


Alex



More information about the Python-list mailing list