Hi everyone,
I am working on a checkbook balancer for school and my code looks like this:
def process(balance):
trans_type= raw_input("Enter Deposit(d), withdrawal(w), print(p), or quit(q):")
amount=input("Enter the amount:")
if amount<0:
print"You've entered an invalid number."
if trans_type=="d":
balance=int(balance)+int(amount)
print"Your current balance is", balance
elif trans_type=="w":
balance=int(balance)-int(amount)
print"Your current balance is", balance
return balance
def main():
balance=5000
restart=raw_input("Would you like to complete a transaction? (y/n):")
while "y"==restart:
balance = process(balance)
main()
However, when I run the program, i doesn't like some of the numbers I put in for seperate transactions. I get this error message: TypeError: int() argument must be a string or a number, not 'NoneType'. Does anyone know how to fix this? Its due tonight at midnight. PLZ help
Thanks in advance,
Cam