programming-examples/python/List/Python program to sum all the items in a list.py
2019-11-15 12:59:38 +01:00

6 lines
151 B
Python

def sum_list(items):
sum_numbers = 0
for x in items:
sum_numbers += x
return sum_numbers
print(sum_list([1,2,-8]))