Dec-07-2016, 10:09 PM
I am trying to write a budget program. I need to figure out how to keep a running total. How do I update the variable
bal via a user input? I have tried while and for loops. This is as close as I can get.
bal = 0.00
def budget():
menu = ('1 Set Ballance', '2 Add Transaction', '3 Check Ballance')
for m in menu:
print '%s' % m
what = raw_input('What do you want to do?\n> ').isdigit()
print bal + what
budget()Output:1 Set Ballance
2 Add Transaction
3 Check Ballance
What do you want to do?
> 1
1.0
