Every time the turtle is clicked, how would I have it increment the variable clicks by 1:
import turtle
jeff = turtle.Turtle()
jeff.shape("turtle")
jeff.color("blue")
clicks=0
def left(x,y):
jeff.left(90)
clicks=clicks+1
print "you have"+clicks+"clicks."
jeff.onclick(left)
When I type this in, on the line clicks=clicks+1 it gives me:
UnboundLocalError: local variable 'clicks' referenced before assignment