Background
Hello there! I'm on an exciting journey as I pursue my M.Tech in Computer Science & Engineering. I've been delving into the world of Python, learning its ins and outs. Once I got the hang of the basics, I jumped right into an engaging project for my portfolio. Let me share the story with you!
Imagine this: I'm right in the middle of figuring out how to fund my education. That's when it hit me—why not make my very own tool to guide me in choosing the best education loan? And that's how my Education Loan Calculator idea came to life.
You know what I wanted? A simple tool to compare different loan options based on what I need for my studies. I've put my heart into crafting a calculator that considers important stuff like the total loan amount, total interest to be paid , and the loan duration. Hence, painting a clear picture of my financial responsibilities and helps me make smart choices about financing my education.
Here, is a video showing working of my portfolio project:
Terminal based Education loan Calculator
This code defines a Python class called EducationLoanCalculator that helps calculate and display details about education loan payments. Let's break down how it works step by step:
-
Initialization (
__init__method):- The class is initialized with two lists:
private_bankscontaining names of private banks andgovt_bankscontaining names of government banks. - The
format_inrmethod is defined to format numeric amounts as Indian Rupees (₹) with two decimal places.
- The class is initialized with two lists:
-
Bank Selection (
select_bank_typeandselect_bankmethods):-
select_bank_typedisplays an ASCII art banner representing the calculator and prompts the user to choose between government and private bank loans. - Depending on the user's choice, the program sets
self.banksto the respective list of banks.
-
-
Bank Selection and Loan Details (
select_bankandget_loan_detailsmethods):-
select_bankdisplays a list of available banks based on the previous choice. - The user selects a bank, and the chosen bank's name is stored in
self.selected_bank_name.
-
-
User Input and Loan Calculation (
get_loan_detailsandcalculate_loanmethods):-
get_loan_detailsprompts the user to input the loan amount, interest rate, and loan term. -
calculate_loancomputes the monthly payment, total payment with interest, and total interest paid using mathematical formulas.
-
-
Displaying Loan Details (
display_loan_detailsmethod):-
display_loan_detailspresents the final calculated details of the education loan, including bank name, loan amount, interest rate, loan term, monthly EMI, total interest paid, and total payable with interest.
-
-
Running the Calculator (
runmethod):- The
runmethod orchestrates the entire process by calling the previously defined methods in the appropriate order.
- The
-
Main Program (
if __name__ == "__main__":)block:- An instance of the
EducationLoanCalculatorclass is created. - The
runmethod of the instance is invoked, initiating the calculator's operation.
- An instance of the
When you run this script, the program guides you through selecting a type of bank loan, choosing a bank, entering loan details, calculating payments, and finally displaying the comprehensive education loan details based on your inputs. This object-oriented approach helps organize the program's functionality into well-defined methods and enhances code readability and maintainability.
For those curious about the inner workings, you can access the complete source code here
Conclusion
Summing up my Python basics exploration, I've built something interesting—an Education Loan Calculator. It helps me pick the best education loan by comparing things like loan amount, interest, and time.
Want to see it in action? Check out this video. And if you're curious about the code, you can find it on GitHub.
This project shows how coding can make complex choices easier. Thank You!
Top comments (0)