Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python reduce function to sum array

from functools import reduce

scores = [3, 3, 80, 3, 1]
total = reduce(lambda x, y: x + y, scores)
print(total)
 
PREVIOUS NEXT
Tagged: #python #reduce #function #sum #array
ADD COMMENT
Topic
Name
9+1 =