import operator


def which_button(btn_dict):
    """
    Assesses which button was pressed given the time
    each button was pressed at. It finds the latest
    pressed button and returns the key for it.

    Parameters
    ----------
    btn_dict : dict
        an input dict in the form of {'button name': float(n_clicks_timestamp)}

    Returns
    -------
    dict_key
        Returns whatever the dict keys are for the key that was pressed latest

    """
    return max(btn_dict.items(), key=operator.itemgetter(1))[0]