Write a program to EMI calculator

lakshmi_prithanadesan_32

Lakshmi Pritha Nadesan

Posted on November 17, 2024

Write a program to EMI calculator

EMI calculator:

An EMI Calculator helps you estimate your monthly installments easily. Once you enter the necessary details such as the loan amount, loan term, and interest rate, the bank's EMI calculator will instantly display your estimated Equated Monthly Installment (EMI).

To calculate your EMI, you can use the following formula:

EMI = [P x R x ( 1 + R )^N] / [( 1 + R )^N -1]

Where :

P = Principal Amount

R = Monthly Interest Rate (Annual Interest Rate / 12 months)

N = Loan Tenure in months

Example:

# Input the loan amount
loan = int(input("Enter the loan amount: "))

# Input the loan tenure in years and convert to months
tenure_year = int(input("Enter the loan tenure in years: "))
tenure_month = tenure_year * 12  # Convert years to months
print("Loan tenure in months:", tenure_month)

# Input the interest rate per year and convert to monthly interest rate
interest_year = float(input("Enter the interest per year: "))
interest_month = interest_year / 12 / 100  # Convert annual interest rate to monthly decimal rate
print("Interest per month:", interest_month)

# Calculate EMI using the formula
emi = loan * (interest_month * (1 + interest_month) ** tenure_month) / ((1 + interest_month) ** tenure_month - 1)

# Display the calculated EMI, rounded to 2 decimal places
print("EMI:", round(emi, 2))
Enter fullscreen mode Exit fullscreen mode

Output:

Enter the loan amount:500000
Enter the loan tenure in years :10
Loan tenure in months: 120
Enter the interest per year:3.5
Interest per month: 0.002916666666666667
EMI: 4944.29


Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
lakshmi_prithanadesan_32
Lakshmi Pritha Nadesan

Posted on November 17, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Write a program to EMI calculator
python Write a program to EMI calculator

November 17, 2024