PEP 284, Integer for-loops

David Eppstein eppstein at ics.uci.edu
Wed Mar 6 22:20:36 EST 2002


In article <3C86D7CA.F53189AE at cosc.canterbury.ac.nz>,
 Greg Ewing <greg at cosc.canterbury.ac.nz> wrote:

> > In your notation how would you do the following?
> > 
> > for x in range(n-1,-1,-2):
> 
> for 0 <= i < n/2:
>   x = 2*i + 1
>   ...

Not quite the same, if n is odd.



More information about the Python-list mailing list