def math_answer_retry(question, answer):
    """The purpose of this function is to give the user the opportunity to
    re-submit their answer to a given question in the honeybee_math()
    function until they enter the correct integer answer. The function first
    ensures the answer is an integer and then compares it to the correct
    answer to see if the new answer is correct. If not, the user is prompted
    to enter a new answer. This loop continues until the user enters the
    correct answer."""
    # The question is reprinted for the user and they are prompted to submit
    # a new answer stored in new_answer
    print(question)
    new_answer = input("Enter in your new answer: ")
    new_answer_check = 0
    # A try statement is used to check and see if the new answer is a valid
    # integer input. If so, the value new_answer_check continues to the
    # if statement.
    try:
        new_answer_check = int(new_answer)
    # If the user input cannot be converted into an integer class,
    # the function restarts
    except ValueError:
        print("\nOops! Please make sure your answer is an integer.")
        math_answer_retry(question, answer)
    # An if statement compares new_answer_check to answer (which now holds
    # the correct answer) and if the answers match then the user is
    # congratulated. If new_answer still does not match the value of answer
    # then the function restarts.
    if new_answer_check == answer:
        print("\nAwesome! That's correct.")
        return new_answer_check
    # If the user is incorrect, the function starts over so the user has
    # another opportunity to input the correct answer
    else:
        print("\nSorry! Try again.")
        math_answer_retry(question, answer)