HOW TO DOWNLOAD MATER CALCULATOR

def loan_calculator(loan_amount, annual_interest_rate, loan_term_years): # Convert annual interest rate to a monthly interest rate monthly_interest_rate = annual_interest_rate / 100 / 12 # Total number of payments (months) total_payments = loan_term_years * 12 # Calculate monthly payment using the formula if monthly_interest_rate > 0: monthly_payment = (loan_amount * monthly_interest_rate) / (1 - (1 + monthly_interest_rate) ** -total_payments) else: monthly_payment = loan_amount / total_payments return monthly_payment # Input values loan_amount = float(input("Enter the loan amount: ")) annual_interest_rate = float(input("Enter the annual interest rate (in %): ")) loan_term_years = int(input("Enter the loan term (in years): ")) # Calculate monthly payment monthly_payment = loan_calculator(loan_amount, annual_interest_rate, loan_term_years) # Output the result print(f"The monthly payment is: ${monthly_payment:.2f}")

Comments

Popular posts from this blog

## Top Blogs for Quick Meals, Healthy Tips & Budget Cooking