I am only starting out programming and currently making a text game. I know there is no goto command in python and after doing some research I understood that I have to use loops to replace that command but it just isn't doing what i was hoping it would do. Here's my code:
print('Welcome to my bad game!')
print('Please, press Enter to continue.')
variable=input()
if variable == '':
print('You are in a dark forest. You can only choose one item. Press 1 for a flashlight and press 2 for an axe.')
while True:
item=input()
if item=='2':
print('Bad choice, you lost the game.')
quit()
if item=='1':
print('Good choise, now you can actually see something.')
So my problem with this is that if the player chooses the 'wrong' item the program just kills itself but I would want it to jump back to the beginning. I actually don't know if this is even possible but better ask than just wonder.