Introduction-Programming-Python icon indicating copy to clipboard operation
Introduction-Programming-Python copied to clipboard

Update Module4MortgageCalculatorChallengeSolution.py

Open StephenAjayi opened this issue 9 years ago • 1 comments

These videos are great but this challenge gave me a few problems because the monthly payments seemed astronomical. After some tinkering around i realized a couple things in the given info were inaccurate:

  1. The interest amount is compounded monthly, so if a user entered .05 as as their interest rate would actually be paying 5% interest per month, 60% interest a year and 600% interest on a 10 year loan. I made the change to line 17 to reflect interest properly.

2 For the monthly mortgage calculation, numberOfPayments should be an exponent on both sides of the equation , rather than being multiplied. I made this change to lines 23-24 as well.

StephenAjayi avatar Nov 19 '15 23:11 StephenAjayi

I believe the formula in this challenge is wrong. It should be: M=L[i(1+i)^n]/[(1+i)^n-1] This is the correct way to calculate the monthly payment. You can check it out multiplying M*n the result must be bigger than L.

Rpasinatto avatar Feb 25 '19 19:02 Rpasinatto