I'm trying to create a code in Python that calculates the remaining value in my VR and alerts me if the average per day drops to 25. It's an attempt to understand better while and break.
I created a variable for the total amount I get and one for the current value, which is the total amount minus one input that asks how much I spent today. When I run the code, it looks like the value is being added to my total value, rather than subtracted. Does anyone know where I went wrong?
PS: X = is the number of days counted in a month.
GASTODIA = int(input("Quanto você gastou hoje almoçando?"))
VRTOTAL = (35 * 30)
VRATUAL = (35 * 30) - (GASTODIA)
x = 1
MEDIARESTANTE = VRATUAL/(30 - x)
while MEDIARESTANTE > 25:
GASTODIA = int(input("Quanto você gastou hoje almoçando?"))
x = x + 1
MEDIARESTANTE = VRATUAL / (30 - x)
print("Você ainda tem " + str(MEDIARESTANTE) + " por dia para gastar.")
if MEDIARESTANTE < 25:
print("Pisa no freio, amigão, você só tem 25 reais por dia agora")
break