The sum() in Python is an inbuilt function that takes an iterable and returns the sum of items in it. The sum () function adds the elements of an iterable and returns the sum. The sum of numbers in the list is required everywhere.
sum(iterable, start)
The sum () function adds start and elements of the given iterators from left to right.
The iterable may be Python list, tuple, set, or dictionary.
See the following examples.
To find a sum of list in Python, use the sum() method. You just need to define the list and pass the list as a parameter to sum() function, and in return, you will get the sum of list items.
#python #python sum