Simple python iteration question

Shawn Milochik Shawn at Milochik.com
Tue Aug 14 18:59:44 CEST 2007


<snip>
> Use the enumerate() builtin.
>
>     >>> l = ['a', 'b', 'c']
>     >>> for i, v in enumerate(l):
>     ...     print i, v
>     ...
>     0 a
>     1 b
>     2 c
>
> --


Just for my own sanity: Isn't this the third response advocating the
use of enumerate()? Did the other responses not get through, or was
this a time-delay thing?

Thanks,
Shawn



More information about the Python-list mailing list