def update_light(command, light):
    """Compute new light status.

    Args:
        command (str): 'toggle', 'turn on' or 'turn off'
        light (bool): Light status before command execution

    Returns:
        bool: New light status

    """
    logic = {"toggle": not light, "turn on": True, "turn off": False}
    return logic[command]