Iterating over indices in a list

Richard Brodie R.Brodie at rl.ac.uk
Wed Feb 19 09:08:21 EST 2003


"Joakim Hove" <hove at ii.uib.no> wrote in message news:4yu1f0gyd6.fsf at skjellgran.ii.uib.no...

> Somewhere I stumbled over a new, and more elegant (based on iterators
> ?) alternative to this ugly construction, but now I can not find
> it.

The enumerate builtin:
http://www.python.org/doc/2.3a1/whatsnew/section-enumerate.html






More information about the Python-list mailing list