Skip to content

Commit 78c7031

Browse files
committed
Update Module4MortgageCalculatorChallengeSolution.py
1 parent b9e8d51 commit 78c7031

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Solutions/Module4MortgageCalculatorChallengeSolution.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
monthlyPayment = 0
44
loanAmount = 0
55
interestRate = 0
6-
numberOfPayments = 0
6+
NofPayments = 0
77
loanDurationInYears = 0
88

99
#Ask the user for the values needed to calculate the monthly payments
@@ -17,11 +17,11 @@
1717
interestRate = float(strInterestRate)
1818

1919
#Since payments are once per month, number of payments is number of years for the loan * 12
20-
numberOfPayments = loanDurationInYears*12
20+
NofPayments = loanDurationInYears*12
2121

2222
#Calculate the monthly payment based on the formula
23-
monthlyPayment = loanAmount * interestRate * (1+ interestRate) * numberOfPayments \
24-
/ ((1 + interestRate) * numberOfPayments -1)
23+
monthlyPayment = loanAmount * interestRate * (1+ interestRate) * NofPayments \
24+
/ ((1 + interestRate) * NofPayments -1)
2525

2626
#provide the result to the user
2727
print("Your monthly payment will be " + str(monthlyPayment))

0 commit comments

Comments
 (0)