commit c19ecb2ae9efae42ca91a101291eac1d21669403 Author: logen Date: Tue Oct 5 11:20:58 2021 -0400 First Commit diff --git a/main.py b/main.py new file mode 100644 index 0000000..39c6396 --- /dev/null +++ b/main.py @@ -0,0 +1,61 @@ +MONTHS_PER_YEAR = 12 +WEEKS_PER_YEAR = 52 +# Grab income +HOURS_WORKED=40 +WAGES = 14.5 +TAX_BUFFER = 0.8 + +#<<<<<<<<<<<<<<<<<<<<<<< Add all your bills here >>>>>>>>>>>>>>>>>>>>>>>> +bills = { + "water": 50, + "gas": 50, + "electric": 130, + "insurance": 100, + "car payment": 200, + "rent": 875, + "internet": 80 +} + + +def income(): + weeklyIncome = HOURS_WORKED * WAGES * TAX_BUFFER + yearlyIncome = weeklyIncome *WEEKS_PER_YEAR # Weeks per year + monthlyIncome = yearlyIncome/MONTHS_PER_YEAR + + income = { + "weekly": weeklyIncome, + "monthly": monthlyIncome, + "yearly": yearlyIncome + } + return income + +def toUSD (x): + return "${:,.2f}".format(x) + +income = income() +#add some space +print() +print("You worked", HOURS_WORKED, "hours.") +print("Your wages are", toUSD(WAGES), "per hour.") +print() +print("Your income:") +for x, y in income.items(): + print("\t" + x, toUSD(y)) +# Grab all bills +print() +print("Your bills:") +for x, y in bills.items(): + print("\t" + x, toUSD(y)) + +billTotal = 0 +for x in bills.values(): + billTotal = billTotal+x +print("Total:") +print("\t" + toUSD(billTotal)) + +print() +print("Remaining Monthly:") +print("\t" + toUSD(income["monthly"]-billTotal)) + +print("Remaining Yearly:") +print("\t" + toUSD(income["yearly"]-billTotal*MONTHS_PER_YEAR))