# Print error? I'm really confused

Ugh, this again? Again, I have to bother you guys with a simple problem.

``````#repl.it

print"By Christina Maverick, Ionix Game Studios"

#OUTER
def house():
name = input("name: ")

print"Your difficulty is based on how you play. Text based games are for people with a visual imagination, so there really is no difficulty."
answer = input("The game begins. You're in a mansion, and your family seems to have left. There is a fireplace lit up. There is a staircase, and oddly, there is a crack in the fireplace, just under the fire. " #Randomly placed to see if house() is working
print"You look around and you see a lantern on a table. Along with it, are 2 oil jars each filled half way with oil."
print"You go up the staircase and you see two doors. Try the first door or the second door?"

#INNER
def staircase():
key=["key"]
if name in key:
print "I have the "+key+", I will unlock the first door."
elif name in enemies:
print"I don't have the "+key+", so I don't have the ability to open this locked door."
else:
print"Key? I didn't find a "+key+". I have to go find it."
print"You go into the room. You see a key on the desk along with a tinderbox. "
else:
staircase()
staircase()

elif answer == "go in the cavehole" or answer == "go in":
print"You almost fall to your death! Luckily, you survive that steep fall."
else:
print"Great, you've confused the game, now choose what answers are given to you! >:D"
house()
#???
'''else:
def #():
else:
print ("")
#()'''

#()
``````

Error:

File “”, line 15
print"You look around and you see a lantern on a table. Along with it, are 2 oil jars each filled half way with oil."
^
SyntaxError: invalid syntax

EDIT The “^” is actually on the 2, not the word print. Also, when I cut and paste line 15, it also comes up with another confusing error:

``````File "<stdin>", line 16
^
``````

SyntaxError: invalid syntax
Unknown error.

Since we know the error is above the carat point, it turns out to be this line… The missing colon.

Make sure you clean up your code a little bit prior to submitting a post. You can see what it’ll look like on the right hand side of your screen when replying or submitting a topic. I cleaned it up for you so you can see the difference in presentation for yourself

~lolman

Uh, thanks…

“The missing colon”

That sounds really weird, but it helped, thanks.

1 Like

Here’s another error I can’t fix, I’m using Pythoniter to check my script now, and I can’t seem to figure out how to fix this.

It comes up with this error in CodeCademy Labs:

Here’s the script, and uh…
#repl.it

print"By Christina Maverick, Ionix Game Studios"

def house():
name = input("name: ")

``````  '''print"Your difficulty is based on how you play. Text based games are for people with a visual imagination, so there really is no difficulty."
answer = input("The game begins. You're in a mansion, and your family seems to have left. There is a fireplace lit up. There is a staircase, and oddly, there is a crack in the fireplace, just under the fire."
print"You look around and you see a lantern on a table. Along with it, are 2 oil jars each filled half way with oil."
'''print"You go up the staircase and you see two doors. Try the first door or the second door?"

#INNER
def staircase():
key=["key"]
if name in key:
print "I have the "+key+", I will unlock the first door."
elif name in enemies:
print"I don't have the "+key+", so I don't have the ability to open this locked door."
else:
print"Key? I didn't find a "+key+". I have to go find it."
print"You go into the room. You see a key on the desk along with a tinderbox. "
else:
staircase()
staircase()

elif answer == "go in the cavehole" or answer == "go in":
print"You almost fall to your death! Luckily, you survive that steep fall."
else:
print"Great, you've confused the game, now choose what answers are given to you! >:D"
``````

house()
#This part down here isn’t right, I’m sorry. How do I make it accurate with the other parts of the code??
‘’‘else:
def #():
else:
print ("")
#()’’’

#()

File “”, line 15
print"You go up the staircase and you see two doors. Try the first door or the second door?"
^
SyntaxError: invalid syntax