def get_user_response(question, valid_responses, error_message=None):
    """
    Function to obtain input from the user.
    :param question: string Question to ask user
    :param valid_responses: list of valid responses to use in error catching
    :param error_message: string Message to display if an exception occurs
    :return: user decision
    """
    while True:
        try:
            decision = int(input(question))
            if decision not in valid_responses:
                raise ValueError
        except ValueError:
            if error_message:
                print(error_message)
            else:
                print('Sorry, please provide a valid input....')
            continue
        else:
            break
    return decision