def policy(states):
    """
    Generate policy

    Parameters
    ----------
    states : list of tuples
            List with all possible combinations of dealer card, player card, 
            and whether or not the player has a usable ace
    Returns
    -------
    pi : dict
        policy which maps states (keys) onto actions (values)

    """
    pi = {}
    for state in states:
        if state[1] >= 20:
            pi[state] = 1 # stick
        else:
            pi[state] = 0 # hit
        
    return pi