Given a sequence , this function produces an iterator that iterates over the
pairs of values S( where each i,
v) is a position in i, and each S is the corresponding
value. For more information on iterators, see Section 17.2, “Iterators: Values that can produce a sequence of
values”.
v
>>> L = ['Ministry', 'of', 'Silly', 'Walks'] >>> for where, what in enumerate(L): ... print "[%d] %s" % (where, what) ... [0] Ministry [1] of [2] Silly [3] Walks