Python Turtle Tutorial Last Updated : 13 Aug, 2025 Comments Improve Suggest changes Like Article Like Report Python’s Turtle module lets you create drawings by controlling a “turtle” that moves and draws on the screen. It’s great for beginners to learn programming concepts through visual and interactive coding. Turtle is commonly used for teaching basics, making shapes and simple animations.Important Facts to KnowUses easy commands for movement and drawing.Provides instant visual feedback for better learning.Included in Python’s standard library—no installation needed.How Turtle WorksThe turtle moves around the screen, drawing lines as it moves.You can move the turtle forward, backward, turn it left or right and control its drawing attributes.The pen can be lifted up or put down to start or stop drawing.Example: Drawing a Square Python import turtle t = turtle.Turtle() for _ in range(4): t.forward(100) t.right(90) turtle.done() OutputSquareExplanation:turtle.Turtle() creates a turtle object to draw with.for _ in range(4): repeats the next steps 4 times (once for each side).t.forward(100) moves the turtle forward 100 pixels, drawing a line.t.right(90) turns the turtle 90° to the right for the next side.Table of Content1. Basic Movement Methods2. Drawing and Utility Methods3. Pen Control Methods4. Event Handling Functions5. Working with Turtle State6. Working with Turtle Screen7. Special Turtle Methods8. Turtle Exercises and Projects1. Basic Movement MethodsThese methods control the position and direction of the turtle. Use them to make your turtle walk, turn and move to specific spots.turtle.backward()turtle.left()turtle.right()turtle.setx()turtle.sety()turtle.seth()turtle.home()turtle.speed()2. Drawing and Utility MethodsThese commands let you create patterns, mark positions, and check where your turtle is. They’re useful for building more advanced designs.turtle.dot()turtle.undo()turtle.stamp()turtle.clearstamp()turtle.towards()turtle.heading()turtle.xcor()turtle.ycor()3. Pen Control MethodsPen control lets you decide when to draw and when to move without leaving a mark. You can also adjust stroke width and write text on the screen.3.1 Pen Position and Drawing Controlturtle.up() or turtle.penup()turtle.down() or turtle.pendown()turtle.isdown()turtle.width()turtle.pen()turtle.write()3.2 Color and Fill Controlturtle.color()turtle.fillcolor()turtle.pencolor()turtle.filling()turtle.begin_fill()turtle.end_fill()turtle.clear()4. Event Handling FunctionsTurtle can respond to mouse clicks, keyboard presses, and timers, allowing you to make interactive programs.4.1 Mouse and Keyboard Event Setupturtle.onclick()turtle.onkey()turtle.onscreenclick()turtle.onrelease()4.2 Timers, Drag and Exitturtle.ontimer()turtle.ondrag()turtle.exitonclick()turtle.done()5. Working with Turtle StateThe turtle has a “state” - its position, direction, visibility and shape. You can adjust these to create different effects.5.1 Visibility and Shape Controlturtle.showturtle()turtle.isvisible()turtle.shape()turtle.turtlesize()turtle.tilt()turtle.shapetransform()5.2 Advanced Shape and Position Controlturtle.settiltangle()turtle.shearfactor()turtle.get_poly()turtle.resizemode()turtle.pos()6. Working with Turtle ScreenThe screen is the canvas for your turtle drawings. You can customize it with backgrounds, titles and coordinate systems.6.1 Screen Setup and Resetturtle.reset()turtle.resetscreen()turtle.Screen().setup()turtle.clear()turtle.bgpic()turtle.Screen().turtles()turtle.setworldcoordinates()6.2 Input, Size, Title and Window Controlturtle.textinput()turtle.window_height()turtle.window_width()turtle.screensize()turtle.title()turtle.done()turtle.bye()7. Special Turtle MethodsThese are extra features for cloning turtles, managing the undo history, and accessing pen or shape details.7.1 Cloning and Undo Controlturtle.clone()turtle.undobufferentries()turtle.setundobuffer()7.2 Pen, Shapes and Screen Accessturtle.getpen()turtle.getshapes()turtle.get_shapepoly()turtle.getscreen()8. Turtle Exercises and ProjectsPracticing with projects is the fastest way to master Turtle. Start small, then challenge yourself with more complex designs.8.1 Beginners:Get coordinate of screenDraw square and rectangleDraw color-filled shapesDraw polygon (hexagon, octagon, any polygon)Draw star and color-filled starDraw rainbowWrite text (e.g., "GFG")Draw smiling face emoji8.2 Intermediate:Draw Olympic symbolDraw concentric VIBGYOR circlesDraw dot patternsDraw clock design and digital clockDraw Tic Tac Toe boardDraw chessboardDraw spiraling stars and colorful spiral web8.3 Advanced:Create custom turtle shapesDraw layered colored spider webDraw Y fractal treeMake Indian flagCreate simple animationsCreate two-player gameCreate snake gameCreate pong game Comment More infoAdvertise with us A abhishek1 Follow Improve Article Tags : Python Python-turtle Practice Tags : python Explore Python FundamentalsPython Introduction 3 min read Input and Output in Python 4 min read Python Variables 6 min read Python Operators 5 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 7 min read Python Functions 8 min read Recursion in Python 6 min read Python Lambda Functions 6 min read Python Data StructuresPython String 6 min read Python Lists 6 min read Python Tuples 6 min read Dictionaries in Python 7 min read Python Sets 10 min read Python Arrays 9 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 6 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 2 min read Python MySQL 9 min read Python Packages 12 min read Python Modules 7 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 11 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 6 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 15+ min read StatsModel Library- Tutorial 4 min read Learning Model Building in Scikit-learn 8 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 7 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 10 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 7 min read Python | Build a REST API using Flask 3 min read How to Create a basic API using Django Rest Framework ? 4 min read Python PracticePython Quiz 3 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like