def ask(question):
    """Gets the answer to a yes or no question"""
    while True:
        user_input = input(question + " (y/n) ").lower()
        if user_input.lower().startswith("y") or user_input.lower().startswith("n"):
            # code to handle the Australian vernacular
            if "yeah nah" in user_input.lower():
                return ask("Do you mean \"Yeah nah yeah sure\" or \"Yeah nahh nahhh\" mate?")
            else:
                return user_input.lower().startswith("y")
        else:
            print("Error: invalid input, try again.\n")