Professional Documents
Culture Documents
Print Me PDF
Print Me PDF
Problem 1:
def f unky(f,a):
def g(x):
return f(a*x)
return g
Problem 2:
def c ompose(f,g):
def function(x):
return g(f(x))
return function
Problem 3:
def p ower(x, n):
if n == 0:
return 1
elif n < 0:
return 1/power(x,-n)
else:
return x * power(x,n-1)