from typing import Set


def prompt_y(dependent: Set[str]) -> str:
    """Prompt the user for the dependent variable to look up

    >>> prompt_y({'slope', 'year'})
    What value would you like to look up?
    >? CO2
    Invalid input! Please enter one of slope | year
    What value would you like to look up?
    >? year
    'year'
    """
    y = input('What value would you like to look up?').lower()
    while y not in dependent:
        y = input('Invalid input! Please enter one of ' + ' | '.join(dependent))

    return y