liste = [1,2,3,4] tot = 0 for i in liste:   tot = i + tot print(tot)

Read more of this post