Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python program to find Cumulative sum of a list

list=[10,20,30,40,50]
new_list=[]
j=0
for i in range(0,len(list)):
    j+=list[i]
    new_list.append(j)
     
print(new_list)
#code given by Divyanshu singh
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Python #program #find #Cumulative #sum #list
ADD COMMENT
Topic
Name
5+2 =