def validate_input(question, values):
    """Return the user selected value, and it must be valid based on *values*."""
    while True:
        options = values.split('/') 
        prompt = '[' + values + ']'
        value = input(question + prompt + ': ')
        value = value.lower()
        if not value in options:
            print("An invalid choice is entered. Choose from", prompt)
        else:
            break
    return value