Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace two dropped characters
  • Loading branch information
rhettinger committed May 25, 2023
commit 5debc13f893a83930c6e179ade9f83dbf71a680f
2 changes: 1 addition & 1 deletion Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ loops that truncate the stream.
# Amortize a 5% loan of 1000 with 10 annual payments of 90
>>> account_update = lambda bal, pmt: round(bal * 1.05) + pmt
>>> list(accumulate(repeat(-90, 10), account_update, initial=1_000))
[1000, 960, 918, 874, 828, 779, 728, 674, 618, 559, 49
[1000, 960, 918, 874, 828, 779, 728, 674, 618, 559, 497]

See :func:`functools.reduce` for a similar function that returns only the
final accumulated value.
Expand Down