Hi,
can someone please tell me why I am getting follwing error code:
TypeError: ‘int’ object is not iterable
My code:
checking_balance= [0]
savings_balance= [0]
def check_balance(account_type, checking_balance, savings_balance):
if account_type == 'checking':
balance = checking_balance
elif account_type == 'savings':
balance= savings_balance
else:
print('Unsuccessful, please enter checking or savings')
balance_statement = print('Your', str(account_type), 'equals', str(balance))
return balance_statement
def make_deposit(account_type, amount, checking_balance, savings_balance):
deposit_status = ''
if amount > 0:
if account_type == 'savings':
savings_balance += amount
deposit_status = 'successful'
elif account_type == 'checking':
checking_balance += amount
deposit_status = 'successful'
else:
deposit_status = 'Unsuccessful, please enter \checking\ or \savings'
else:
deposit_status = 'unsuccessful, please enter an amount greater than 0'
deposit_statement = 'Deposit of', str(amount), 'to your', str(account_type), 'account was', str(deposit_status)
print(deposit_statement)
return savings_balance, checking_balance
savings_balance, checking_balance = make_deposit('savings', 10, checking_balance, savings_balance)
Regards