Fix parameter name for enumerate().
This commit is contained in:
parent
e321c2f37d
commit
21f990cf0e
|
@ -335,14 +335,15 @@ available. They are listed here in alphabetical order.
|
||||||
Using :func:`divmod` with complex numbers is deprecated.
|
Using :func:`divmod` with complex numbers is deprecated.
|
||||||
|
|
||||||
|
|
||||||
.. function:: enumerate(iterable)
|
.. function:: enumerate(sequence)
|
||||||
|
|
||||||
Return an enumerate object. *iterable* must be a sequence, an :term:`iterator`, or some
|
Return an enumerate object. *sequence* must be a sequence, an
|
||||||
other object which supports iteration. The :meth:`next` method of the iterator
|
:term:`iterator`, or some other object which supports iteration. The
|
||||||
returned by :func:`enumerate` returns a tuple containing a count (from zero) and
|
:meth:`next` method of the iterator returned by :func:`enumerate` returns a
|
||||||
the corresponding value obtained from iterating over *iterable*.
|
tuple containing a count (from zero) and the corresponding value obtained
|
||||||
:func:`enumerate` is useful for obtaining an indexed series: ``(0, seq[0])``,
|
from iterating over *iterable*. :func:`enumerate` is useful for obtaining an
|
||||||
``(1, seq[1])``, ``(2, seq[2])``, .... For example:
|
indexed series: ``(0, seq[0])``, ``(1, seq[1])``, ``(2, seq[2])``, .... For
|
||||||
|
example:
|
||||||
|
|
||||||
>>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter']):
|
>>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter']):
|
||||||
... print i, season
|
... print i, season
|
||||||
|
|
Loading…
Reference in New Issue