A) The example of sequential-driven code is:
for i in range(x):
for j in range(y):
t.forward(z)
t.right(360 / y)
t.right(360 / x)
This code runs in a sequential manner, executing the loops one after the other in a defined order.
B) The example of event-driven code is:
def h1():
t.forward(30)
def h2():
t.left(45)
def h3():
t.right(45)
wn.onkey(h1, "Up")
wn.onkey(h2, "Left")
wn.onkey(h3, "Right")
wn.listen()
wn.mainloop()
This code involves event-driven programming as it responds to user input events (key presses in this case) to call the associated functions.