I'm trying to calculate the budget by asking the user to enter the amount they want to budget and break it down by specific amount and substract that amount from the original with every iteration and show them the last result
budget = int(input("Please enter the amount you have budgeted for this month: "))
print(budget)
expensess = ['Rent','Food','Car','Gym','Phone','Travel','Savings']
balance=0
budget = budget
for i in expensess:
added_balance = int(input('How much did you budget for '+str(i)))
new_balance = int(budget - added_balance)
print(new_balance)
balance += new_balance
budget = balance
print("budget is "+str(budget))
if balance is > budget:
print("You underbudgeted ")
else:
print('Good Job you would have extra money to spend'+ )
when I run this
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
=== RESTART: C:\Users\boxfo\Desktop\Programming Challenges\Budget Analysis.py ==
Please enter the amount you have bugeted for this month: 6000
6000
How much did you budget for Rent2000
budget is 4000
How much did you budget for Food2000
budget is 6000
How much did you budget for Car3000
budget is 9000
How much did you budget for Gym