def make_withdraw(balance, password):
    """Return a password-protected withdraw function.

    >>> w = make_withdraw(100, 'hax0r')
    >>> w(25, 'hax0r')
    75
    >>> error = w(90, 'hax0r')
    >>> error
    'Insufficient funds'
    >>> error = w(25, 'hwat')
    >>> error
    'Incorrect password'
    >>> new_bal = w(25, 'hax0r')
    >>> new_bal
    50
    >>> w(75, 'a')
    'Incorrect password'
    >>> w(10, 'hax0r')
    40
    >>> w(20, 'n00b')
    'Incorrect password'
    >>> w(10, 'hax0r')
    "Your account is locked. Attempts: ['hwat', 'a', 'n00b']"
    >>> w(10, 'l33t')
    "Your account is locked. Attempts: ['hwat', 'a', 'n00b']"
    >>> type(w(10, 'l33t')) == str
    True
    """
    attempts_lst = []
    password_lst = [password]
    def withdraw(amount, input_word):
        nonlocal balance, attempts_lst
        if len(attempts_lst)==3:
            return "Your account is locked. Attempts: " + str(attempts_lst)
        if input_word not in password_lst:
            attempts_lst.append(input_word)
            
            return 'Incorrect password'
        if amount > balance:
           return 'Insufficient funds'
        
        balance = balance - amount
        return balance
    return withdraw