Wednesday, October 1, 2025
HomeLanguagesturtle.stamp() function in Python

turtle.stamp() 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.stamp()

This method is used to stamp a copy of the turtleshape onto the canvas and return its id. It doesn’t require any argument. Whatever the shape of the turtle is, it is printed at that point and continues with the next instructions.

turtle.stamp()

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

Example 1:

Python3




# import package
import turtle
 
# forward turtle by 100
turtle.forward(100)
 
# print the turtle shape
turtle.stamp()
 
# and then continue
# forward turtle by 100
turtle.forward(100)


 

 

Output: 

 

Here the middle one arrow is due to the stamp and next is turtle’s head

 

Example 2:

 

Python3




# import package
import turtle
 
# loop for printing some stamps
for i in range(15):
     
    # for motion
    turtle.forward(100+10*i)
     
    # printing turtle shape
    turtle.stamp()
     
    # for pattern
    turtle.right(90)


 

 

Output :

 

Printing the turtle’s shape at each movement

 

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

Most Popular

Dominic
32330 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6703 POSTS0 COMMENTS
Nicole Veronica
11867 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11926 POSTS0 COMMENTS
Shaida Kate Naidoo
6815 POSTS0 COMMENTS
Ted Musemwa
7078 POSTS0 COMMENTS
Thapelo Manthata
6775 POSTS0 COMMENTS
Umr Jansen
6774 POSTS0 COMMENTS