Thursday, September 4, 2025
HomeLanguagesturtle.getshapes() function in Python

turtle.getshapes() function in Python

The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.

turtle.getshapes()

This function is used to return a list of names of all currently available turtle shapes. It doesn’t require any argument.

Syntax :

turtle.getshapes()

Below is the implementation of the above method with some examples :

Example 1 :

Python3




# import package
import turtle
print(turtle.getshapes())


Output :

['arrow', 'blank', 'circle', 'classic', 'square', 'triangle', 'turtle']

Example 2 :

Python3




# import package
import turtle
shapes = turtle.getshapes()
  
  
# set speed to slowest
turtle.speed(1)
  
# draw all shapes
for i in range(len(shapes)):
    
  # shape
  turtle.shape(shapes[i])
    
  # motion
  turtle.forward(100)
  turtle.right(51.42)
  turtle.stamp()


Output :

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32261 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6626 POSTS0 COMMENTS
Nicole Veronica
11799 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11855 POSTS0 COMMENTS
Shaida Kate Naidoo
6748 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6696 POSTS0 COMMENTS
Umr Jansen
6716 POSTS0 COMMENTS