Which of the following is an example of event-driven code?(1 point)%0D%0AResponses%0D%0A%0D%0At = turtle.Turtle()%0D%0Awn = turtle.Screen()%0D%0Awn.setColor("red")%0D%0At.pd()%0D%0At.speed(0)%0D%0At = turtle.Turtle() wn = turtle.Screen() wn.setColor("red") t.pd() t.speed(0)%0D%0A%0D%0Adef h1():%0D%0A t.forward(30)%0D%0Awn.onkey(h1, "Up")%0D%0Adef h1(): t.forward(30) wn.onkey(h1, "Up")%0D%0A%0D%0Aimport turtle%0D%0At = turtle.Turtle()%0D%0Awn = turtle.Screen()%0D%0Aimport turtle t = turtle.Turtle() wn = turtle.Screen()%0D%0A%0D%0Afor i in range(x):%0D%0A for j in range(y):%0D%0A t.forward(z)%0D%0A t.right(360 / y)%0D%0A t.right(360 / x)

1 answer

The correct example of event-driven code is:

def h1():
t.forward(30)
wn.onkey(h1, "Up")