1

I get an error

invalid syntax

when I run the following code:

print("Hello how old are you?(years)"
print ("(1) 0-10")      
print ("(2) 11-20")
print ("(3) 21-30")
print ("(4) 31-40")
print ("(5) 41-50")
print ("(6) 51-60")
print ("(7) 61-70")
print ("(8) 71-80")
print ("(9) 81-90")
print ("(10)90+")
  c=input
  if int(c)==1
print ("")

On this line

print ("(1) 0-10")

it says print is a invalid syntax, if i delete that line it moves on to the next, and so on. Please could i have some help here? Thanks!

2
  • 4
    Missing ) on this line: print("Hello how old are you?(years)" Commented Nov 14, 2013 at 19:01
  • Thank you very much. i didn't see that!!! Commented Nov 17, 2013 at 9:39

1 Answer 1

8
print("Hello how old are you?(years)") # <== missing this )

You're next syntax errors will probably be the following:

c=input() # <== missing ()

if int(c)==1: # <== missing :
    print ("") # missing indentation  

Just fyi whenever you get that kind of behaviour if i delete that line it moves on to the next, and so on. that probably means the syntax error is not on that line but the line before it.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you again for your answer, i didn't realise it was the line before!
@Calzs34 please consider accepting this answer if it helps you meta.stackoverflow.com/a/5235/235416

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.