A.3 Syntax Errors

These suggest there is a sufficiently severe problem with the way your code is written that Python cannot understand it. Common examples are missing out the colon at the end of a line containing a for, if or while loop; writing a condition with just on =, e.g.

  if x = 5:
      print "x is equal to five"

Check that you haven't forgotten to end any strings with quotes and that you have the right number of parantheses. Missing out parentheses can lead to a syntax error on the next line. You will get a SyntaxError when you run your program if the user does not respond to and input() function. Incorrectly indenting your program might also cause SyntaxErrors