Can you solve this please

what is the problem in this code
it says syntax error

def game_begins():
print("""you enter a dark room with two doors. 
which door would you like to go through door #1 or door#2""")
      
door = input(">")
if door== "1":
  print("there is a table with someting shineing whirling around")
  print("what will you do?")
  print("1. you go near and tesr the wrilpool")
  print("2. you will go near and just watch it")
  print("3. you close the door")
swhirl = input(">")
if swhirl == "1":
  print("your vision blurs your feel like your falling from very high place.you hit something hard and die")
elif swhirl=="2":
  print("a gigantic tiger paw scraces your face and you die")
else: 
 game_begins()


else:
  print("you enter a room with screens and a lever which is kept towards open") 

What’s the syntax error message? Is it related to indentations?

no it shows it is in the last else line

The game_begins() function executes when it is called - in that else. This is why the error appears there.
But as Graham said, the error is that the code is not indented.
Also, what is that last else? You can have many elifs but only one else.
L.E. As I am watching your code better and reading your message more attentively , I get the error appears on the last else - told you why.
At first I thought it appeared at that else that recursively calls the function.
Anyway, indent everything in the function and do something about having a single else and more elifs.

Can you post the error message? It’s not clear from the code above if this is actually how it’s indented or just a result of posting it here. Does you actual code look like the code below in terms of indentation?

def game_begins():
    print("""you enter a dark room with two doors. 
                 which door would you like to go through door #1 or door#2""")
      
    door = input(">")
    if door== "1":
        print("there is a table with someting shineing whirling around")
        print("what will you do?")
        print("1. you go near and tesr the wrilpool")
        print("2. you will go near and just watch it")
        print("3. you close the door")

        swhirl = input(">")
        if swhirl == "1":
                print("your vision blurs your feel like your falling from very high place.you hit something hard and die")
        elif swhirl=="2":
                print("a gigantic tiger paw scraces your face and you die")
        else: 
                game_begins()

    else:
        print("you enter a room with screens and a lever which is kept towards open") 

Your code is pretty mangled so can you do me a favor and edit it so it’s indented the same?

Now, I think it’s because you have 1 space under the else, but 2 under the if and elif. That’s why Python uses 4 spaces. Telling the difference between 1 and 4 spaces is easier than between 1 and 2.

But, I could be wrong, so reformat your code and add the error message you get. (You can click the … and then the pencil to edit your post).

thank you i figured out the problem in my code

Do you mind posting a follow-up with your solution so other people can see what you did?

actually i just took out the second else