Note - Double Click to Copy Code Contact Us!

Loan Management System Project in Python

Tech Doubility
Loan Management System Project in Python

HTML
  1. import tkinter as tk
  2. from tkinter import messagebox
  3.  
  4. # Create the main window
  5. root = tk.Tk()
  6. root.title("Loan Management System")
  7.  
  8. # Create the labels and entry fields
  9. label_name = tk.Label(root, text="Name:")
  10. label_name.grid(row=0, column=0)
  11. entry_name = tk.Entry(root)
  12. entry_name.grid(row=0, column=1)
  13.  
  14. label_loan_amount = tk.Label(root, text="Loan Amount:")
  15. label_loan_amount.grid(row=1, column=0)
  16. entry_loan_amount = tk.Entry(root)
  17. entry_loan_amount.grid(row=1, column=1)
  18.  
  19. label_interest_rate = tk.Label(root, text="Interest Rate:")
  20. label_interest_rate.grid(row=2, column=0)
  21. entry_interest_rate = tk.Entry(root)
  22. entry_interest_rate.grid(row=2, column=1)
  23.  
  24. label_duration = tk.Label(root, text="Duration (in months):")
  25. label_duration.grid(row=3, column=0)
  26. entry_duration = tk.Entry(root)
  27. entry_duration.grid(row=3, column=1)
  28.  
  29. # Function to calculate the monthly installment
  30. def calculate_installment():
  31. try:
  32. loan_amount = float(entry_loan_amount.get())
  33. interest_rate = float(entry_interest_rate.get())
  34. duration = int(entry_duration.get())
  35.  
  36. interest = loan_amount * interest_rate / 100
  37. total_amount = loan_amount + interest
  38. monthly_installment = total_amount / duration
  39.  
  40. messagebox.showinfo("Result", "Monthly Installment: ${:.2f}".format(monthly_installment))
  41. except ValueError:
  42. messagebox.showerror("Error", "Invalid input. Please enter numeric values.")
  43.  
  44. # Create the calculate button
  45. calculate_button = tk.Button(root, text="Calculate", command=calculate_installment)
  46. calculate_button.grid(row=4, column=0, columnspan=2)
  47.  
  48. # Start the main event loop
  49. root.mainloop()
  50.  

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.