def check_answer(question, answer):
    while True:
        current_answer = eval(input(question))
if current_answer == answer:
    break
print('Something wrong with question {}'.format(question))
return current_answer
answerX = check_answer('Question about X?\n', 'TrueX')
answerY = check_answer('Question about Y?\n', 'TrueY')
answerZ = check_answer('Question about Z?\n', 'TrueZ')
How to return a specific point after an error in 'while' loop