financial.equated_monthly_installments

Program to calculate the amortization amount per month, given - Principal borrowed - Rate of interest per annum - Years to repay the loan

Wikipedia Reference: https://en.wikipedia.org/wiki/Equated_monthly_installment

Functions

equated_monthly_installments(→ float)

Formula for amortization amount per month:

Module Contents

financial.equated_monthly_installments.equated_monthly_installments(principal: float, rate_per_annum: float, years_to_repay: int) float

Formula for amortization amount per month: A = p * r * (1 + r)^n / ((1 + r)^n - 1) where p is the principal, r is the rate of interest per month and n is the number of payments

>>> equated_monthly_installments(25000, 0.12, 3)
830.3577453212793
>>> equated_monthly_installments(25000, 0.12, 10)
358.67737100646826
>>> equated_monthly_installments(0, 0.12, 3)
Traceback (most recent call last):
    ...
Exception: Principal borrowed must be > 0
>>> equated_monthly_installments(25000, -1, 3)
Traceback (most recent call last):
    ...
Exception: Rate of interest must be >= 0
>>> equated_monthly_installments(25000, 0.12, 0)
Traceback (most recent call last):
    ...
Exception: Years to repay must be an integer > 0