Loop through list elements to get cumulative sums
I’m very new to python. I’m trying to create a loop so that I can get cumulative sums of the elements in a list. For example, given a list [3, 2, 1] I’m hoping to get [3 (first number), 5 (3+2), 6 (3+2+1)], [2 (second number), 3 (2+1)] and [1].