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

6 lines
133 B
Python

def sum(numbers):
total = 0
for x in numbers:
total += x
return total
print(sum((8, 2, 3, 0, 7)))