def sum(lst): tot=0 for i in range(0,len(lst)): lst[i]+=1 tot += lst[i] return tot a = range(1,4) print a print sum(a) print a