Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could you help me find 3 errors in this python code and fix them? Thank you! The formula for amortization is a= pi 1-(1+i) where

image text in transcribed

Could you help me find 3 errors in this python code and fix them?

Thank you!

The formula for amortization is a= pi 1-(1+i)" where a is the monthly payment, p is the initial principal, i is the monthly interest rate, and n is the number of months. def amortize (principal, rate, years): **** "Return monthly payment for an amortized loan. Parameters: principal: initial principal balance rate: annual interest rate years: number of years over which payment is to be made Returns: monthly payment amount monthlyRate = rate / 12 months = years * 12 payment principal * monthlyRate / 1 - (1 + monthlyRate)**-months return payment rate= def main(): balance = float(input("How much are you borrowing? ")) float(input("What is the interest rate (e.g., 4 for 4%)? ") rate = rate / 100.0 years = float(input("What is the term of the loan, in years?")) monthly = round ( amortize(balance, rate, years), 2) print("Your monthly payment will be $" + monthly) main()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

2. What potential barriers would you encourage Samuel to avoid?

Answered: 1 week ago

Question

6. How would you design your ideal position?

Answered: 1 week ago