Cody Bable

Generation

generate functionFri, 28 Apr 2023

create a function to redraw the drawing in turtle from user mouse clicks

def draw_from_click(turtle, color): """ create a function to redraw the drawing in turtle from user mouse clicks """ def draw(x, y): turtle.color(color) turtle.goto(x, y) turtle.stamp() return draw def draw_from_click(turtle, color): def draw(x, y): turtle.color(color) turtle.goto(x, y) turtle.stamp() return draw screen.onscreenclick(draw_from_click(blue_turtle, "blue")) screen.onscreenclick(draw_from_click(red_turtle, "red"))

Questions about programming?Chat with your personal AI assistant