Cumulative Sum is the sequence of partial sum i.e. the sum till current index.
Program to find the cumulative sum of elements of the list,
In this problem, we will take the list as input from the user. Then print the cumulative sum of elements of the list.
Example:
Input:
[1, 7, 3, 5, 2, 9]
Output:
[1, 8, 11, 16, 18, 27]
To perform the task, we need to iterate over the list and find the sum till the current index and, store it to a list and then print it.
Program to find the cumulative sum of elements in a list
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer