user1586423
user1586423

Reputation: 33

Python (3.2.3) If Or Statement Syntax Error

Thanks for reading this. I'm trying to do this lab from programarcadegames.com where you have to write a quiz. I finished my first question and got a syntax error. Here's the code:

print ("This is a quiz.")
x=0
questionOne=input("First question! How many fingers does a human have? "
if questionOne == "10" or questionOne.lower() == "ten":
                   print ("Correct! Good job!")
                   x+=1
else:
                   print ("Not quite... try the next one!")
print ("You got the following amount of questions right:",x) 

When I go to run it, I get a syntax error and the Python shell editor window highlights the colon at the end of line four. Removing the colon causes it to highlight print on the next line. I've also tried removing the or statement and just making line four:

 if questionOne == "10":

for the sake of troubleshooting, but I ended up with the same error and red colon. Any ideas? Criticisms? Mocking comments? Thanks again for reading.

EDIT: It wasn't the .lowercase() thing, fixed that.

Upvotes: 3

Views: 34005

Answers (1)

BrenBarn
BrenBarn

Reputation: 251378

You are missing a closing parenthesis on the previous line (the line with input).

Upvotes: 8

Related Questions