Question
I'm trying to modify this logo so that it moves in response to events. I have to use a 2 key press events, and two
I'm trying to modify this logo so that it moves in response to events. I have to use a 2 key press events, and two mouse click events.
import turtle screen = turtle.Screen() # background color screen.bgcolor("lightblue") # turtle object y = turtle.Turtle() # define function # for drawing rays of Sun def drawFourRays(t, length, radius): for i in range(4): t.penup() t.forward(radius) t.pendown() t.forward(length) t.penup() t.backward(length + radius) t.left(90) # Draw circle # to make sun y.penup() y.goto(85, 110) y.fillcolor("yellow") y.pendown() y.begin_fill() y.circle(45) y.end_fill() #Sun rays y.penup() y.goto(85, 169) y.pendown() drawFourRays(y, 85, 54) y.right(45) drawFourRays(y, 85, 54) y.left(45)
turtle. color('red') style = ('Arial', 30, 'italic') turtle. write("Sammy's makes fun in the sun", font=style, align='center') turtle. hideturtle() # To keep the # output window active turtle.done()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started