Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

It says that there is a syntax error, but I don't know why.

+3 votes
asked Nov 21 by Christopher Clark (150 points)
if building_1 == "2":

print("You walk into the building.".center(150))

1 Answer

+1 vote
answered Nov 22 by Peter Minarik (40,320 points)

Generally, it is a good idea to share

  • the whole code of yours, not just a single line as the problem could originate from before
  • what the exact error message is

Without knowing what exactly is going on, I'd say that you need to indent the print as it belongs to the if statement's body.

Another problem could be building_1 is not being a string or could be of some other type that's not comparable to a string.

Nothing else could be told without knowing more.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...