My function returns None
. I have checked to make sure all the operations are correct, and that I have a return statement for each function.
def parameter_function(principal, annual_interest_rate, duration):
n = float(duration * 12)
if annual_interest_rate == 0:
r = float(principal / n)
else:
r = float(annual_interest_rate / 1200)
p = principal
return (p, r, n)
def monthly_payment_function(p, r, n):
monthly_payment = p * ((r * ((1 + r) ** n)) / (((1 + r) ** n) - 1))
result = monthly_payment_function(p, r, n)
return result
See Question&Answers more detail:os