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 turtle
print (turtle.getshapes())
|
Output :
['arrow', 'blank', 'circle', 'classic', 'square', 'triangle', 'turtle']
Example 2 :
Python3
import turtle
shapes = turtle.getshapes()
turtle.speed( 1 )
for i in range ( len (shapes)):
turtle.shape(shapes[i])
turtle.forward( 100 )
turtle.right( 51.42 )
turtle.stamp()
|
Output :
Last Updated :
23 Jul, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...