Cody Bable

Generation

generate functionFri, 28 Apr 2023

create a function to store the mouse clicks and redraw from the mouse clicks in turtle.

import turtle wn=turtle.Screen() wn.bgcolor("lightgreen") #tess=turtle.Turtle() #tess.color("blue") points=[] def add_point(x,y): points.append((x,y)) print(points) wn.onclick(add_point) for point in points: x,y=point print(x,y) turtle.mainloop()

Questions about programming?Chat with your personal AI assistant