Mindy's Portfolio

Mindy's PortfolioMindy's PortfolioMindy's Portfolio
  • Home
  • Bio
  • Contact Me
  • Python
  • C#
  • More
    • Home
    • Bio
    • Contact Me
    • Python
    • C#

Mindy's Portfolio

Mindy's PortfolioMindy's PortfolioMindy's Portfolio
  • Home
  • Bio
  • Contact Me
  • Python
  • C#

Trinket Sandbox

Here are samples of my python

 All programs can be run in the console.

Programs also available from GitHub

https://github.com/mexgirlmindy

Financial Calculator with GUI


#Simple calculator for converting hourly pay to an annual salary. I haven't been able to find an online calculator that does all this. 


import tkinter as tk
from math import *

def budget(Monthlypay):
   tk.Label(text='Monthly Take Home Pay ' + str(Monthlypay)).pack()
   tk.Label(text='Hourly Pay ' + str(round(Monthlypay/160,2))).pack()
   tk.Label(font=16, text='Budget ').pack()
   tk.Label( text='Monthly Pay: ' + str(Monthlypay)).pack()
   tk.Label( text='Maximum Rent: ' + str(round(Monthlypay*.3,2))).pack()
   tk.Label( text='Monthly Utilities: ' + str(round(Monthlypay*.1,2))).pack()
   tk.Label(text='Monthly Transportation Cost : ' + str(round(Monthlypay * .2, 2))).pack()
   tk.Label(text='Monthly Spending Money: ' + str(round(Monthlypay * .1, 2))).pack()
   tk.Label(text='Monthly Student Loans: ' + str(round(Monthlypay * .15, 2))).pack()
   tk.Label(text='Monthly Groceries: ' + str(round(Monthlypay * .05, 2))).pack()

def calculate(event):
   Salary = int((entry.get()))
   Monthlypay = Salary*.85*.083 # Estimated taxes
   res.configure(  text="Maximum House Mortgage: " + str(4*Salary))
   budget(Monthlypay)


w = tk.Tk()
w.title("Mindy's Budget Calculator")
tk.Label(w, text="Enter Annual Salary:", font=16).pack()
#tk.Label(w, text="                                              ", font=16).pack()
entry = tk.Entry(w)
entry.bind("<Return>", calculate)
entry.pack()
res = tk.Label(w)
res.pack()
w.mainloop()







Financial Calculator without GUI for Widget above


#Simple calculator for converting hourly pay to an annual salary. I haven't been able to find an online calculator that does all this. 


 

def Gen_budget(budget):

    print ("************************************************ ")

    print ("General budget ")

    print ("************************************************ ")

    monthly_pay = budget/12

    print ("Monlthy Pay:                "  + str(round(monthly_pay,2)) )

    print ("Maximum Rent:               "  + str(round(monthly_pay*.30,2)) )

    print ("Maximum Utilities:          "  + str(round(monthly_pay*.10,2)) )

    print ("Maximum Transportion Cost:  "  + str(round(monthly_pay*.20,2)) )

    print ("Maximum Spending Money:     "  + str(round(monthly_pay*.10,2)) )

    print ("General Savings:            "  + str(round(monthly_pay*.15,2)) )

    print ("Student Loans:              "  + str(round(monthly_pay*.05,2)) )

    print ("Groceries:                  "  + str(round(monthly_pay*.10,2)) )

def Gen_mortage(pay):

    print ("************************************************ ")

    print ("General Mortage Calculator ")

    print ("************************************************ ")

    Home_Cost = pay * 4

    print ("House Price Estimate "  + str(round(Home_Cost,2)) )

    print ("Note: For a 30 year mortage, house payment is less than rent")

def Gen_pay(rate):

    annual_hours = 2080.00

    annual_rate = rate*annual_hours

    print ("************************************************ ")

    print ("Annual Salary")

    print ("************************************************ ")

    print ("Annual pre-tax pay :        "  + str(annual_rate) )

    average_take_home_pay = .85

    after_taxes = float(annual_rate* average_take_home_pay)

    print ("Annual post-tax pay :       "  + str(after_taxes))

    Gen_budget(annual_rate)

    Gen_mortage(annual_rate)

print('What is the hourly rate?')

hourly_rate = int(input())

Gen_pay(hourly_rate)







Copyright © 2025 Mindy's Portfolio - All Rights Reserved.

Powered by