New to programming and have just written my first program in Python. The program works well in the initial steps but whatt I'm not sure about is how to store values so the next time the programm is ran it starts with those values. Here is the code in case I'm not making sense:
monthly_wage = int(input("How much were you paid this month? "))
monthly_days = int(input("How many days this month? "))
saved = 0
while (monthly_days > 0):
daily_max = round(monthly_wage/monthly_days)
daily_spend = int(input("How much have you spent today? "))
daily_remain = round(daily_max - daily_spend, 2)
saved = saved + daily_remain
monthly_wage = monthly_wage - daily_spend
monthly_days -- 1
print("Your remaining wage is: £", monthly_wage)
print("You can spend a total of £", daily_max, " each day")
print("You have saved £", saved, " so far this month")
print("There are ", monthly_days, " days remaining")
So what i want is the next time I run the programme instead of running through the initial steps it would start at requesting the daily spend. I'm assuming I will need to store the values in a file and rewrite the program to take the values from that file but i'm not having much luck when searching how this is done. Hopefully someone can point me in the right direction for this.
Thanks.