Translate this to python?

pyguy2 at pyguy2 at
Wed Jan 4 08:24:40 EST 2006

For some reason, ocassionally when  I see xrange, I think "But wasn't
that deprecated  since range is now a . . oh wait that's xreadlines".
xrange is a  cool thing the few times where you really need it.


> Not sure what i is really for, but j seems to be independent,
> so perhaps (also untested, and caveat: it's past bedtime)
> i = nPoints - 1
> for j in xrange(nPoints):
>     # whatever
>     i = j
> Regards,
> Bengt Richter

More information about the Python-list mailing list