Coding Practice
Q2: Reduce
reduce takes in a two argument function combiner and a non-empty sequence seq and combines the elements in seq into one value using combiner.
def reduce(combiner, seq):
"""Combines elements in seq using combiner.
>>> reduce(lambda x, y: x + y, [1, 2, 3, 4])
10
>>> reduce(lambda x, y: x * y, [1, 2, 3, 4])
24
>>> reduce(lambda x, y: x * y, [4])
4
"""
"*** YOUR CODE HER