What is the output of the following Python code snippet?
from itertools import accumulate
print(list(accumulate([1, 2, 3])))
print(list(accumulate([1, 2, 3])))
Correct answer
D. [1, 3, 6]
7 views
D. [1, 3, 6]
7 views
accumulate() returns running totals.
Asked in: Python Interview Advanced
https://docs.python.org/3/library/index.htmlNot sure why the answer is D? Ask here and get an explanation.