As far as I understand, the reduce function takes a list l and a function f. Then, it calls the function f on first two elements of th
l
f
You could also implement factorial using reduce.
def factorial(n): return(reduce(lambda x,y:x*y,range(n+1)[1:]))