turtle.speed() function in Python Last Updated : 20 Mar, 2025 Comments Improve Suggest changes Like Article Like Report 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 accordingly.Example: Python # import package import turtle # slowest speed turtle.speed(1) # turtle movement turtle.forward(150) OutputExplanation: In this example, the turtle's speed is set to the slowest (speed(1)), meaning its movement will be slow and deliberate. It then moves forward by 150 units in a straight line.Syntax of turtle.speed():turtle.speed(speed=None)Parameters: speed: (Optional) An integer between 0 and 10 or a predefined speed string.Speed Values:The speed range is 0-10, where:0 (fastest) → No animation, instant movement1 (slowest) → Slowest speed3 (slow) → Slower than normal6 (normal) → Default speed10 (fast) → Fastest animationIf a value greater than 10 or less than 0.5 is provided, the speed is automatically set to 0.Examples of turtle.speed()Below is the implementation of the above method with some examples :Example 1: Speed Variation in a Pattern Python # import package import turtle # loop for pattern for i in range(10): # set turtle speed turtle.speed(10-i) # motion for pattern turtle.forward(50+10*i) turtle.right(90) OutputExplanation: The loop decreases the turtle's speed from 10 to 1, while it moves forward by an increasing distance (50 + 10*i) and turns right by 90 degrees, creating a slowing spiral pattern.Example 2: Speeding Up After Every Move Python import turtle turtle.speed(1) # Start with the slowest speed for i in range(1, 11): turtle.speed(i) # Increase speed gradually turtle.forward(20 * i) turtle.right(45) turtle.done() OutputSpeeding ArrowsExplanation: Turtle starts at speed 1 and increases speed with each iteration while moving forward and turning right by 45 degrees.Example 3: Using Predefined speed strings Python import turtle turtle.speed("fast") # Use predefined speed string turtle.circle(100) # Draw a circle with radius 100 turtle.done() OutputCircleExplanation: Turtle moves quickly ("fast", speed 10) to draw a circle with a radius of 100. The drawing is nearly instant but animated. Setting speed(0) makes it instant without animation. Comment More infoAdvertise with us Next Article turtle.speed() function in Python D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Practice Tags : python Similar Reads turtle.shape() function in Python 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 curs 3 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.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.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.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.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.screensize() function in Python The turtle.screensize() function in Python's turtle module is used to set or retrieve the size of the drawing canvas (the area where the turtle moves and draws). This function helps in customizing the workspace according to user requirements.Example: Checking default screen sizePythonimport turtle # 2 min read turtle.resizemode() 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.resizemode() This function is used set resizemode to one of the values: "aut 1 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.tilt() 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.tilt() This function is used to rotate the turtleshape by the angle from its 1 min read Like