Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Please add a loop to ask the user if they would like to try a different loan amount. def greeting ( ) : print

Python
Please add a loop to ask the user if they would like to try a different loan amount.
def greeting():
print("Greetings! Please fill out this loan application.")
def thankyou():
print("Thank you for your loan application.")
def calculate_loan_total(amount, interest, years):
total = amount
for year in range(1, years +1):
total *=(1+ interest)
print(f"Year {year}: ${total:.2f}")
def main():
greeting()
amount = float(input("Please enter the loan amount: "))
interest_rate = float(input("Please enter the annual interest rate (in percentage, e.g.,10 for 10%): "))
interest = interest_rate /100
years = int(input("Please enter the number of years for the loan: "))
print("
Calculating loan values for each year...
")
calculate_loan_total(amount, interest, years)
thankyou()
if __name__=="__main__":
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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions