Ask coding questions

← Back to all posts
hi im trying to find all the shapes i can get.
kannibalistic (104)

To be specific, how many shapes are there?
Names please!

Answered by CodingEssence (126) [earned 5 cycles]
View Answer
Comments
hotnewtop
CodingEssence (126)

If you want to do this, you need to do this:

print(turtle.Screen().getshapes())  

Then it will print out the list of shapes, and you cant do this:

print(turtle.Turtle().getshapes())  

because it will return this:

Traceback (most recent call last):
  File "main.py", line 5, in <module>
    print(turtle.Turtle().getshapes())
AttributeError: 'Turtle' object has no attribute 'getshapes'

Because getshapes is an attribute for the Screen() class, not the Turtle() class.

And if you wanted a list of the names, here you go:

['arrow', 'blank', 'circle', 'classic', 'square', 'triangle', 'turtle']
kannibalistic (104)

I'm using python, so any thing that fits into
r6.shape("") will work!