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