enumerate

enumerate(iterable)

Returns an enumeration iterator. iterable must be a sequence, an iterator, or some other object which supports iteration.

The next method of the iterator returns a tuple containing a count (from zero) and the corresponding value obtained from iterating over iterable. enumerate is useful for obtaining an indexed series: (0, seq[0]), (1, seq[1]), (2, seq[2]), …. (New in version 2.3.)

 

A Django site. this page was rendered by a django application in 0.01s 2010-09-02 15:06:11.270625. hosted by webfaction.