Answers for "print(sum(list))"

18

python sum of list

>>> list = [1, 2, 3]
>>> sum(list)
6
Posted by: Guest on January-27-2020
1

python list sum

To get the sum of a list in python, you just call the built in sum() function.
An example:

>>> lst = [3, 7, 1, 9, 4]
>>> sum(lst)
24
Posted by: Guest on September-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language