Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!