x = 1 n = input("You are in the Lost Forest\n****************\n****************\n :)\n****************\n****************\nGo left or right? ") while n == "right" or n == "Right": if x==1: n = input("You are in the Lost Forest\n****************\n****************\n :(\n****************\n****************\nGo left or right? ") x=x+1 if x<1: n = input("You are in the Lost Forest\n****************\n****************\n (╯°□°)╯︵ ┻━┻\n****************\n****************\nGo left or right? ") print("\nYou got out of the Lost Forest!\n\o/")Hey there;
Strated learning python this semester and Im having some trouble understanding why this code wont work
(Code from MIT Introduction to Computer science)
tried to upgrade it and add a counter but the program seems to crash after one round of the loop...
would love to have your help, Thanks.