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 turtle.setup(400,500) wn = turtle.Screen() wn.title("Handling keypresses!") wn.bgcolor("lightgreen") tess = turtle.Turtle() fightsize = 3 def h1(): tess.forward(50) def h2(): tess.left(45) def h3(): tess.right(45) def h4(): tess.backward(50) def h5(): tess.penup() def h6(): tess.pendown() def h7(): wn.bye() def h8(): tess.pensize(fightsize) fightsize = fightsize+1 def h9(): tess.pensize(fightsize) fightsize = fightsize-1 def h10(): tess.stamp() def h11(): tess.color('green') def h12():

Questions about programming?Chat with your personal AI assistant