Python sum() built-in function

From the Python 3 documentation

Sums start and the items of an iterable from left to right and returns the total. The iterable’s items are normally numbers, and the start value is not allowed to be a string.

Introduction

The sum() function calculates the sum of all items in an iterable (like a list or tuple). You can also provide an optional start value, which is added to the total.

Examples

Summing a list of numbers:

numbers = [1, 2, 3, 4, 5]
print(sum(numbers))
15

Summing with a starting value:

numbers = [1, 2, 3]
print(sum(numbers, 10))  # 10 + 1 + 2 + 3
16