Skip to main content
3 of 4
deleted 5 characters in body

Use it like this.

Use reduce function

from functools import reduce

def reduce_func(n1, n2):

return n1 + n2 

data_list = [2, 7, 9, 21, 33]

x = reduce(reduce_func, data_list)

print(x)