Question: Part 1 Write a function called payment to calculate the payment for a loan. There are three parameters needed: length of loan in years t
Part Write a function called payment to calculate the payment for a loan. There are three parameters needed: length of loan in years annual interest rate, and the amount borrowed, The formula to find the payment is
where
payment
principle loan amount
annual interest rate as a decimal
time in years
The function definition should begin like:
def paymentrate years, principle:
# your implementation code goes here
Part Write a function called totalofPayments to calculate the total amount paid for the loan after the loan is paid. The formula is
where
payment
time years
The function definition should begin like:
def totalofpaymentsrate years, principle:
# your implementation code goes here
Hint: this function can call the payment function to get
Page of
Part Write a function called financeCharge to calculate the total interest paid over the life of the loan. The formula is
where
principle loan amount
total payments
The function definition should begin like:
def financechargerate years, principle:
# your implementation code goes here
Hint: this function can call the total OfPayments function to get
All three functions should be saved in one file called Loanpayment. py Alsa include a program that calls these functions. Use the following values to test your three functions.
Test Values
rate APR
years
principle
rate APR
years
principle
tableResultsPayments:Finance Charge,Total:PaymentsFinance Charg,Total
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
