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
- To find the sale price of an item with given cost and discount
- To calculate perimeter/ circumference and area of shapes such as triangle, rectangle, square and circle
- To calculate simple and compound interest
- To calculate profit loss for a given cost and sale price
<