Looping over lists

Paul Rubin http
Sat May 5 10:53:35 EDT 2007


Dustan <DustanGroups at gmail.com> writes:
> > I think the for i in range() is more readable (Maybe because I'm
> > coming from a c-style syntax language background) -  but what would
> > the benefits of using enumerate be (other that being more . . .
> > pythonesque?)
> 
> It doesn't create a whole new list just for iterating.

That's what xrange is for.



More information about the Python-list mailing list