Bank ATM Login in Python

This is an ATM program with basic functions. After new user registration, the user is able to proceed to the login function and bank operations after. However, existing users can’t proceed to bank operations after login as the program just stops running. How can I fix that?

.....
def init():
    print('Welcome to Esther Bank')
    
    have_account = int(input('Do you have an account with us? n 1 (yes) 2 (no) n'))

    if(have_account == 1):
        login()
    elif(have_account == 2):
        register()
    else:
        print('You have selected an invalid option')
        init()


#user login
def login():
    print('***Login to your account***')

    user_acct = int(input('Enter your account number: n'))
    user_pwd = input('Enter your password: n')

    for acct_no, user in database.items():
        if user_acct == acct_no:
            if user_pwd == user[3]:
                bank_operations(user)
        else: 
            print('Invalid account or password, try again')
            login()

#user registration
def register():
    print('********Register******')
    email = input('Enter your email address: n')
    f_name = input('Enter your first name: n')
    l_name = input('Enter your last name: n')
    password = input('Create a strong password: n') 

    account_number = generate_acct_number()
    balance = 0

    database[account_number] = [f_name, l_name, email, password, balance]
    
    print('Welcome %s, your account has been created n' %f_name)
    print('Your account number is %s n' %account_number)
    print('Ensure your keep your account number and password safe')
    login()


#bank operations
def bank_operations(user):
    print('Welcome %s %s' %(user[0], user[1]))
    print('What would you like to do? n')
    print('1. Deposit')
    
.....

Answer

This is how I would redefine Your login function:

def login():
    print('***Login to your account***')

    user_acct = int(input('Enter your account number: n'))
    user_pwd = input('Enter your password: n')

    if user_acct not in database.keys():
        print('Invalid account or password, try again')
        login()
        return

    if database[user_acct][3] == user_pwd:
        bank_operations(database[user_acct])
    else:
        print('Invalid account or password, try again')
        login()
        return

first check if the user actually is in the database and if not call the function again and stop the current one, if the user is in database just check if passwords match

EDIT: made some more improvements