Skip to content

How to add up a list in Python?

liste = [1,2,3,4]
tot = 0
for i in liste:
  tot = i + tot
See also  Python code snippet - How to update values in tkinter?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.