Python Program to Calculate Monthly EMI

This python program calculates monthly EMI (Equated Monthly Installment)

The EMI formula is as follows :

EMI Formula = p * r * (1+r)^n/((1+r)^n-1)

where

p = Principal or Loan Amount

r = Interest Rate Per Month

n = Number of monthly installments

If the interest rate per annum is R% then interest rate per month is calculated using:

Monthly Interest Rate (r) = R/(12*100)

Program:

# Reading inputs from user
p = float(input("Enter principal amount: "))
R = float(input("Enter annual interest rate: "))
n = int(input("Enter number of months: " ))

# Calculating interest rate per month
r = R/(12*100)

# Calculating Equated Monthly Installment (EMI)
emi = p * r * ((1+r)**n)/((1+r)**n - 1)

print("Monthly EMI = ", emi)

Output

>>> %Run emi.py
Enter principal amount: 25000
Enter annual interest rate: 5
Enter number of months: 12
Monthly EMI =  2140.1870447116867



>>> %Run emi.py
Enter principal amount: 120000
Enter annual interest rate: 7
Enter number of months: 7
Monthly EMI =  17545.183631398173

Check other python source code

<