This is my code:
print('Test Program') print("This is my proga!") name = input("Ваше имя: ") print(name, ", добро пожаловать в темный мир.") answer = 'End' while answer != 'End': answer = input("Ты бы хотел взять какое-нибудь оружие? (Y/N/End): ") if answer1 == "Y": print("1-Пулемёт") print("2-Гранатомет") print("3-Однозарядный пистолет") print("4-АА-12") answer2 = input("Ваш ответ:") if answer2 == '1' or answer2 == '2': print("Хороший выбор.") elif answer2 == '3': print("Плохой выбор, возьми другое.") else: print("Великолепный выбор.") if answer == 'N': print("Ты пацифист? Круто!") else: print("Ладно, подумай ещё.") but it does not work as I would like. The fact is that after entering the name, the code immediately finishes the work, as if this is all written. I want to do this: when pressing Y or N, the code will work fine, that is, press Y or N, select the answer and that's it. And when you press "End" would be the inscription "Okay, think again," and the program would start with the question "Would you like to take some kind of weapon?". So you can do?
answerat the first check of a condition? - Mikhail Vaysman