def get_x_y_value(choices: dict, x_or_y: str) -> int:
    """Returns a valid user choice for the desired x value to be plotted."""

    choice = input(f"Please input the desired value {x_or_y} to plot: ")

    keys_as_strings = [str(key) for key in choices]

    while choice not in keys_as_strings:
        print("That is not an option.")
        choice = input(f"Please input the desired {x_or_y} value to plot: ")

    return int(choice)