Vehicle Loan EMI Calculator Script
# Vehicle Loan EMI Calculator
def calculate_emis(principal, interest_rate, tenure):
"""
Calculates the monthly EMI for a vehicle loan.
Args:
principal
(float): Principal amount of the loan.
interest_rate
(float): Annual interest rate for the loan.
tenure (int): Loan tenure in months.
Returns:
float: Monthly
EMI amount.
"""
# Converting
interest rate to monthly interest rate
monthly_interest_rate = interest_rate / 12 / 100
# Calculating EMI
using the formula
emi = (principal * monthly_interest_rate * (1 + monthly_interest_rate) ** tenure) / ((1 + monthly_interest_rate) ** tenure - 1)
return emi
# Example usage
loan_amount = 1000000
# Principal amount of the loan (e.g., Rs. 10,00,000)
interest_rate = 8.5 #
Annual interest rate (e.g., 8.5%)
loan_tenure = 60 # Loan tenure in months (e.g., 60 months)
emi_amount = calculate_emis(loan_amount, interest_rate,
loan_tenure)
print(f"The monthly EMI amount is: {emi_amount}")
This script defines a function calculate_emis() that takes the principal amount, annual interest rate, and loan tenure as inputs and returns the monthly EMI amount. It uses the standard formula to calculate EMI based on the principal, interest rate, and tenure.
In the example usage section, the script demonstrates how to use the function by passing sample values for the loan amount, interest rate, and tenure. It then prints the calculated monthly EMI amount.
You can modify the values in the example usage section to calculate EMIs for different vehicle loans.