Cody Bable

Generation

generate functionFri, 28 Apr 2023

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

import turtle def draw_art(): window = turtle.Screen() window.bgcolor("white") # create turtle brad = turtle.Turtle() brad.shape("turtle") brad.color("green") brad.speed(10) # create square for i in range(0,36): draw_square(brad) brad.right(10) window.exitonclick() def draw_square(some_turtle): for i in range(0,4): some_turtle.forward(100) some_turtle.right(90) draw_art()

Questions about programming?Chat with your personal AI assistant