Support Forums

Full Version: Help with if syntax
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. I am trying to write a little game, and I am using an if statement (which I have used before, even in this same file they work) and it says my syntax is wrong and I can't figure it out. Any help is appreciated:
print "After another 10 minutes of walking, you hear something sneak up on you. You look behind you and see that it is another monster!"
answer = raw_input("Do you run or try to shoot it? (Run, shoot) ".lower()
if answer == "run" and gun > 0 and bullets > 0 and drinks == 6 :
print "You line up a shot. You narrowly miss it, thanks to your thirst."

It highlights the colon and says "Invalid syntax"

did a little type in the code, "run" should be "shoot", but the syntax error is still there.

and yes, the print is indented
I found it. The parenthesis was BEFORE the quote. My fault
Good job finding the problem, I've reported the thread for you so a mod can lock it.

Have a nice day.