def poly(c):
    terms = []
for i in range(len(c)):
    terms.append(lambda x, n=i: c[n] * x ** n)
return lambda x: sum(f(x) for f in terms)
Python - function that is sum of arbitrary many other functions