There is a piece of code:
for element in questions: while answer != 'д' and answer != 'н': answer = input(element+': ') answer = (((answer[0].lower()).replace('y', 'д')).replace('n', 'н')) if answer != 'д' and answer != 'н': print('Ответ невозможно принять.') With a successful response, the for loop is also interrupted. If you remove the while for loop, it works fine. Please explain why this is happening and where I made a mistake.