Don’t understand this SyntaxError: illegal target for annotation

Look at these lines:

If (y1 < 0): y_movedown()
Elif (y2 > imageheight): y_moveup()
Elif (x1 < 0) : x_moveright()
Elif (x2 > imagewidth): x_moveleft()

IfElif are titled words, when they should be lowercase, so do:

if (y1 < 0): y_movedown()
elif (y2 > imageheight): y_moveup()
elif (x1 < 0) : x_moveright()
elif (x2 > imagewidth): x_moveleft()

Instead.

Leave a Comment