Skip to main content
1 of 4

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)