Bank Teller Project Help


This post is regarding the Bank Teller project in Python course.

My issue is the program adds the “amount” variable to both the savings and checking account variables, which is incorrect. I’ve looked over my code and the solution and I can’t figure out why this is occurring.


You are mixing checking and savings in multiple places.

def check_balance(account_type, checking_balance, savings_balance):
    if account_type == 'checking':
        # type is checking but balance is savings??
        balance = savings_balance

    elif account_type == 'savings':
        # type is savings but balance is checking??
        balance = checking_balance


    # make_deposit function return
    return checking_balance, savings_balance

# make deposit returns checking first then savings, this is swapping the values.
savings_balance, checking_balance = make_deposit('savings', 1, checking_balance, savings_balance)

1 Like