On 02-Oct-10 10:32, Emile van Sebille wrote:
File "my_turtle.py", line 19
if (abs(turtle.position()[0])> turtle.window_height()/2) or
^
SyntaxError: invalid syntax

How does Python know that the next line is the continuation of your if statement, instead of the beginning of a new line of code? You didn't do anything to indicate continuation, so it takes this as an incomplete statement. "If ... stuff ... or... (or what??)"

You need to END that line with a backslash

if (abs(...height()/2) or \
  ...continuation...:

or else make the line break INSIDE a set of parentheses, for Python to keep looking to the next line(s) to complete the statement.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to