def ask_yes_no(prompt='', response_attempt=1):
    """Function to get the user's yes/no response to a question.

    Accepts variations of yes/y, true/t, no/n, false/f, exit/quit/q.

    :param prompt: the question to ask the user.
    :type prompt: str
    :param response_attempt:

        The number of the number of attempts allowed before the
        function exits. This prevents the script from getting stuck in a loop.

    :type response_attempt: int
    :returns:

        The default is False (e.g. user hits Enter without typing
        anything else), but variations of yes or true responses will return
        True instead. If the response is 'exit' or 'quit', the loop is exited
        and None is returned.

    :rtype: bool, None
    """
    response_valid = False
    while response_valid is False and response_attempt > 0:
        response = input(prompt)
        response_attempt -= 1
        if response.lower() in set(['yes', 'y', 't', 'true']):
            response = True
            response_valid = True
        elif response.lower() in set(['no', 'n', 'f', 'false', '']):
            response = False
            response_valid = True
        elif response.lower() in set(['exit', 'quit', 'q']):
            response = None
            response_valid = True
        else:
            response = None
            print('Invalid response. Enter [yes/no/exit].')
    return response
