def player_attr_by_id(roster, player_id, attribute):
    """Returns the attribute of a player given a roaster and a player_id.

    Args:
        roster (dict): Team roster (returned from API)
        player_id (str): Player unique identifier (IDXXXXXXX)
        attribute (str): Attribute from roster dictionary.

    Returns:
        string: Attribute of the person requested.
    """
    new_player_id = player_id.replace("ID", "")
    for roster_item in roster:
        person_id = str(roster_item["person"]["id"])
        person_attr = roster_item["person"][attribute]
        if person_id == new_player_id:
            return person_attr