/Task-2

Loan Repayment Calculator

Primary LanguagePython

The function takes in the loan amount, loan term, interest rate, and repayment frequency as input parameters and returns a dictionary with the total interest, total repayment, and a table showing the breakdown of the loan repayments over the loan term. The interest rate is converted to the interest rate per repayment period based on the repayment frequency, and the repayment period amount is calculated using the formula provided. The function then loops through each repayment period, calculating the interest, principal, and remaining balance, and updating the total interest and total repayment. The information for each period is added to the repayment table, which is returned as part of the results.

How To execute the code

  1. Clone the Repository to your local machine

  2. Navigate to the root folder of the project

  3. On Linux Operating system, Open the Terminal and run the code using python3 main.py

  4. On Windows Operating system, Open the Terminal and run the code using python main.py

You will get an output like the one shown below:

loan repayment