def check_input(choice: str, choices: list):
    """
    Function to check that the provided input is correct, so if it belongs to the list of possible choices. Note that
    the user could digit the index relative to the choice or the choice itself.
    :param choice: provided input to be checked
    :param choices: list of possible choices that the user could do
    :return: True/False depending on the validity of the input and corresponding choice inside the list
    """
    valid = False

    # Check user selection
    if choice.isdigit():
        # If the user selects an index, check that is a valid one (in the list of choices index)
        try:
            choice = choices[int(choice)]
            print('Your choice is {}'.format(choice))
            valid = True
        except IndexError:
            print("WARNING : Wrong choice, unable to find it.")
    else:
        # If the user selects a choice, check that is a valid one (in the list of choices)
        if choice.upper() not in choices:
            print("WARNING : Wrong choice, unable to find it.")
        else:
            print('Your choice is {}'.format(choice.upper()))
            valid = True

    return valid, choice