turtle.shape() function in Python Last Updated : 20 Mar, 2025 Comments Improve Suggest changes Like Article Like Report The turtle module in Python simplifies graphical programming, making it ideal for beginners. It supports both object-oriented and procedural approaches and relies on Tkinter as its graphical engine. One of its key functions, turtle.shape() allows users to set or retrieve the shape of the turtle cursor. This function can assign predefined or custom shapes and if no shape is specified, it returns the current shape.Example: Python import turtle t = turtle.Turtle() # Set the shape to the default "classic" t.shape("classic") # Move the turtle forward t.forward(100) turtle.done() OutputClassic ShapeExplanation: Turtle object is created and its shape is set to "turtle", making it appear like a turtle icon. The turtle then moves forward by 100 units. Finally, turtle.done() is used to keep the window open, allowing the output to be visible.Syntax of turtle.shape()turtle.shape(name=None)Parameters:name: (Optional) The shape name to assign to the turtle.If no argument is passed, it returns the name of the currently set shape.Predefined shapeThe turtle module includes a set of built-in shapes that can be used directly:Shape NameAppearance"classic" (default)A small arrowhead-like shape"arrow" An arrow pointing in the turtle's direction"turtle" A turtle-like shape"circle" A circular shape"square" A square shape"triangle" A triangle shapeThese shapes are stored in the Turtle Screen's shape dictionary, meaning they are predefined and ready for use without requiring additional setup.default : 'classic''arrow''turtle''circle''square''triangle'Examples of turtle.shape()Example 1: Using Different ShapesThe following example demonstrates how to set different shapes for the turtle cursor. Python # import package import turtle # for default shape turtle.forward(100) # for circle shape turtle.shape("circle") turtle.right(60) turtle.forward(100) # for triangle shape turtle.shape("triangle") turtle.right(60) turtle.forward(100) # for square shape turtle.shape("square") turtle.right(60) turtle.forward(100) # for arrow shape turtle.shape("arrow") turtle.right(60) turtle.forward(100) # for turtle shape turtle.shape("turtle") turtle.right(60) turtle.forward(100) Output:Explanation:Default Shape: The turtle starts with the default "classic" shape and moves forward.Circle Shape: The shape is changed to "circle", and the turtle moves in a different direction.Triangle Shape: The shape is changed to "triangle", and the turtle moves again.Square Shape: The shape is changed to "square", and the turtle moves further.Arrow Shape: The shape is changed to "arrow", and the turtle continues moving.Turtle Shape: Finally, the shape is changed to "turtle", and movement continues.Example 2: Animating shape changes Python import turtle import time # Create a turtle object t = turtle.Turtle() # List of shapes shapes = ["arrow", "turtle", "circle", "square", "triangle", "classic"] # Move and change shapes dynamically for shape in shapes: t.shape(shape) t.forward(50) time.sleep(0.5) # Pause for visibility t.hideturtle() turtle.done() OutputShape ChangesExplanation:The turtle iterates through different shapes while moving forward.A time.sleep(0.5) is added to create a smooth animation effect. Comment More infoAdvertise with us Next Article turtle.shape() function in Python D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Practice Tags : python Similar Reads 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 canv 1 min read turtle.speed() function in Python The turtle module in Python enables graphics and animations using Tkinter. It supports object-oriented and procedural approaches. The turtle.speed() method is used to control the speed of the turtle's movement. It accepts a numerical value or a predefined string and adjusts the turtle's speed accord 2 min read turtle.sety() 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.sety() This method is used to set the turtle's second coordinate to y, leavi 1 min read turtle.setx() 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.setx() This method is used to set the turtle's first coordinate to x, leave 1 min read turtle.seth() 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.seth() This method is used to set the orientation of the turtle to to_angle. 2 min read turtle.reset() 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.reset() This function is used to delete the turtle's drawings and restore it 1 min read turtle.get_shapepoly() 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.get_shapepoly() This method is used to return the current shape polygon as a 2 min read turtle.tracer() 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.tracer() This function is used to turn turtle animation on or off and set a 1 min read turtle.register_shape() 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.register_shape()Â This function is used to add a turtle shape to TurtleScree 1 min read turtle.shapetransform() 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.shapetransform() This function is used to set or return the current transfor 2 min read Like