← Go Back
The function is designed to be used on numerical elements.
How to Sum the Elements of a List
Thesum()
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.
🐍 You might also find interesting: