Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sum elements in list python

# Python code to demonstrate the working of 
# sum()
   
numbers = [1,2,3,4,5,1,4,5]
  
# start parameter is not provided
Sum = sum(numbers)
print(Sum)
  
# start = 10
Sum = sum(numbers, 10)
print(Sum)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #sum #elements #list #python
ADD COMMENT
Topic
Name
4+2 =