diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 3c9f334201b..2736263586a 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -96,7 +96,7 @@ loops that truncate the stream. total = next(it) yield total for element in it: - total += element + total = total + element yield total .. versionadded:: 3.2