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 a decimal
time 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 totalofPayments function to get
All three functions should be saved in one file called loanpayment. py Also include a program that calls these functions. Use the following values to test your three functions.
Test Values
rate APR
years
principle
Results
Payments:
Finance Charge:
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
