Get number of iteration

Diez B. Roggisch deets_noospaam at web.de
Thu Jan 29 19:11:26 CET 2004


> In recent versions of Python there is an easier way:
> 
>  >>> for index, value in enumerate(["three", "four", "five", "six"]):
> ...    print index, value
> ...
> 0 three
> 1 four
> 2 five
> 3 six

Boy, one never stops learning. I'll better stop answering here and read
only :)

Diez



More information about the Python-list mailing list