def mult_func(x, *args): total = 1 for func in args: total *= func(x) return total
Very simply returns the product of all args with input x .
Quick example:
def square(n): return n**2 >>> print mult_func(2, square, square) 16 >>> print mult_func(2, square, square, square) 64
source share