diff options
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/itertools.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index fda3beb..ad5a23b 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -194,15 +194,16 @@ loops that truncate the stream. .. versionadded:: 3.1 -.. function:: count(n=0, step=1) +.. function:: count(start=0, step=1) Make an iterator that returns evenly spaced values starting with *n*. Often used as an argument to :func:`map` to generate consecutive data points. Also, used with :func:`zip` to add sequence numbers. Equivalent to:: - def count(n=0, step=1): + def count(start=0, step=1): # count(10) --> 10 11 12 13 14 ... # count(2.5, 0.5) -> 3.5 3.0 4.5 ... + n = start while True: yield n n += step |