May-09-2022, 07:07 PM
(This post was last modified: May-09-2022, 07:10 PM by Gribouillis.)
You can write the while loop like this
# Set a variable for accessing turtle objects i = 0 # Setup a while loop while turtles[i].xcor() < 200: turtles[i := (i + 1) % len(turtles)].forward(randint(0, 5)) turtles[i].home() turtles[i].write(f'winner: {i+1}', font=('system', 25, 'bold')) sleep(5)