Answers for "python reduce function to sum array"

0

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)
Posted by: Guest on July-10-2021

Python Answers by Framework

Browse Popular Code Answers by Language