Contact: aviboots(AT)netvision.net.il
39,890 questions
51,819 answers
573 users
from itertools import * # {a,b,c,...}, are a, a+b, a+b+c print(list(accumulate(range(7)))) # 0,1,2,3,4,5,6 # 0 : 0+1=1 : 0+1+2=3 : 0+1+2+3=6 : 0+1+2+3+4=10 : 0+1+2+3+4+5=15 ... ''' run: [0, 1, 3, 6, 10, 15, 21] '''