Which of the following is an example of event-driven code?(1 point)

Responses

t = turtle.Turtle()
wn = turtle.Screen()
wn.setColor("red")
t.pd()
t.speed(0)
t = turtle.Turtle() wn = turtle.Screen() wn.setColor("red") t.pd() t.speed(0)

for i in range(x):
for j in range(y):
t.forward(z)
t.right(360 / y)
t.right(360 / x)
for i in range(x): for j in range(y): t.forward(z) t.right(360 / y) t.right(360 / x)

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

The correct example of event-driven code is:

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