How does accumulate work? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

How does accumulate work?

30th Apr 2019, 9:58 AM
Noopur
Noopur - avatar
4 Réponses
+ 14
p[0], p[0] + p[1], p[0] + p[1] + p[2] ... accumulate([1,2,3,4,5]) --> 1 3 6 10 15
30th Apr 2019, 10:14 AM
r8w9
r8w9 - avatar
+ 2
r8w9 thanks 😊 I Searched online just now and found the doc: https://docs.python.org/3/library/itertools.html#itertools.accumulate
30th Apr 2019, 10:16 AM
Noopur
Noopur - avatar
+ 1
r8w9 thanks 😊
30th Apr 2019, 10:16 AM
Noopur
Noopur - avatar
+ 1
r8w9 thanks 😊
30th Apr 2019, 10:16 AM
Noopur
Noopur - avatar