I’m probably boring everyone but this is what I made this morning. It was really fun and I’m proud of it. I won’t share anymore unless I come up with something really cool.
# Savings Goal 3.0, 4th Practice Problem with additions
# define a function for annual savings calculation
def savings_goal(salary):
savings = salary * 0.2
return savings
# set input field for annual salary
print("You should be saving!")
print("A good target is 20%.")
salary_input = float(input("What is your annual salary? "))
savings = savings_goal(salary_input)
print("Your annual savings goal is $" +str(savings)) #output
# define a function for a percheck savings amount
def percheck_target(savings, monthly):
percheck = savings / (monthly * 12)
return percheck
# set input field for number of pay periods per month
print(" ") # is there a better way to add a space?
monthly_input = float(input("How many times do you get paid a month? "))
percheck = percheck_target(savings, monthly_input)
print("You should save: $" + str(percheck) + " per paycheck") #output
print(" ") # is there a better way to add a space?
# TRUTH BOMB
def wealth_steal(savings):
steal = savings - (savings * (1-0.06))
return steal
steal = wealth_steal(savings)
print("You will lose: $" + str(steal) + " this year due to inflation.")
print("Maybe you should save in bitcoin.")

