SuperSuz
SuperSuz

Reputation: 11

How can i identify a turtle from a list by its position in Python?

I'm coding a race of multiple turtles, and I would like to access my list of turtles and atm when I print the winner I get " turtle.Turtle object at 0x05D8A770". I would like to get the actual colour of the winning turtle from my list.

Thank you, Suz

Upvotes: 0

Views: 181

Answers (1)

Miriam
Miriam

Reputation: 2721

You can use:

print(winningturtle.pencolor())

or:

print(winningturtle.fillcolor())

depending on which one you want. For more info on turtle, see here

Upvotes: 1

Related Questions