from functools import reduce def poly(*pars): def func(x): def sum(subsum, zipped_par): idx, par = zipped_par return subsum+par*x**idx return reduce(sum, enumerate(pars), 0.0) return func