mercredi 6 mai 2020

python: how do i get the accumulating numbered list from another list [duplicate]

How do i write a function that takes an existing list and returns the list with the accumulating value?

Example

list = [1, 2, 3, 4]

should return:

[1, 3, 6, 10]

Aucun commentaire:

Enregistrer un commentaire