← Go Back

How to Sum the Elements of a List

The sum() built-in function takes an iterable object (usually a list or tuple) and returns the sum of its elements.

>>> sum([1, 2, 3, 4, 5])
15

The function is designed to be used on numerical elements.

lists built-ins


🐍 You might also find interesting: