Calzs34
Calzs34

Reputation: 27

Invalid syntax error when using print

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!

Upvotes: 1

Views: 598

Answers (1)

jramirez
jramirez

Reputation: 8685

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.

Upvotes: 8

Related Questions