和Fibonacci数列相似?
defcumulative_sum(l):
new_l =[]
new_l.append(l[0])
for old in l[1:]:
new_l.append(new_l[len(new_l)-1]+old)
return new_l
和Fibonacci数列相似?
defcumulative_sum(l):
new_l =[]
new_l.append(l[0])
for old in l[1:]:
new_l.append(new_l[len(new_l)-1]+old)
return new_l