[Tutor] What's the invaild syntax? Error message and relative codesupplied.

Alan G alan.gauld at freenet.co.uk
Mon Aug 1 02:24:24 CEST 2005


> What the invalid syntax? Here is the error message:
>  File "D:/Python22/grades.py", line 66
>    which = which-1
>       ^
>SyntaxError: invalid syntax

OK, so it tells you the syntax is wrong and the line it 
detected the error. Try looking at a line or two 
before it.

>            while which != -1:
>                which = int(raw_input("Change which Grade: ")
>                which = which-1

Oh look, you've messed up the parens again, same as last time...

Try checking your past mistakes Nathan, everyone tends to do 
the same things wrong over and over. For me its missing the 
colon at the end of an except statement...

Alan G.


More information about the Tutor mailing list