Python Turtle Tutorial for Kids: Step-by-Step (Beginner Friendly)

Michael Murr··8 min read

Python Turtle is a built-in Python module that draws shapes on screen by moving a small pointer (the "turtle") around. It is one of the best ways for a child to start writing real Python code, because every line of code produces a visible result on screen. Within 30 minutes, most beginners draw their first square. Within a few sessions, they are producing flowers, spirals, and fractal trees that look genuinely impressive. This guide walks through five projects step by step, with the actual code, what it does, and what to try next.

Key Takeaways

  • Python Turtle is included with every standard Python installation. No extra setup is required beyond installing Python itself.
  • Turtle is text-based but produces visual output, which makes it ideal for visual learners moving from Scratch to Python.
  • The five projects below are ordered from simplest to most complex, each introducing one or two new ideas while reusing what came before.
  • Most children aged 10 and up can complete the first three projects in their first session with Turtle.
  • Turtle uses real Python syntax, so a child writing Turtle code is genuinely learning Python, not a simplified educational version.

Table of Contents

Setting Up Python Turtle

Python Turtle is built into Python, so the only setup you need is Python itself. The cleanest way for beginners is Thonny, a free editor designed specifically for Python beginners. It comes with Python included and runs Turtle out of the box.

Once Thonny is installed:

  1. Open Thonny
  2. Create a new file
  3. Save it with a .py extension (for example, my_turtle.py)
  4. Type or paste the code from any project below
  5. Press F5 (or click the green Run button)

A new window opens with the turtle drawing. That is your canvas.

Project 1: Your First Square

The simplest possible Turtle program: tell the turtle to draw a square by hand.

import turtle

t = turtle.Turtle()

t.forward(100)
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)

turtle.done()

What this does: Imports the turtle module, creates a turtle named t, and tells it to move forward 100 pixels, turn right 90 degrees, and repeat four times until it has drawn a complete square. turtle.done() keeps the window open after the drawing finishes.

What's new: The basic commands forward(distance) and right(angle). These are the only commands needed for many simple shapes.

Project 2: A Square With a Loop

The previous code repeats the same two lines four times. Real programmers do not write the same code over and over. They use a loop:

import turtle

t = turtle.Turtle()

for side in range(4):
    t.forward(100)
    t.right(90)

turtle.done()

What this does: The exact same square as Project 1, but with a for loop that runs the two lines four times. The output is identical. The code is shorter and easier to change.

What's new: Combining a for loop with Turtle commands. This is the pattern that powers almost everything else in Turtle. For more on Python for loops specifically, see our Python for loops for kids guide.

Project 3: Polygons of Any Shape

Once you have a loop, you can draw any regular polygon by changing two numbers: the number of sides and the turning angle. The rule: the angle equals 360 divided by the number of sides.

import turtle

t = turtle.Turtle()

sides = 6
side_length = 100
angle = 360 / sides

for side in range(sides):
    t.forward(side_length)
    t.right(angle)

turtle.done()

What this does: Draws a hexagon (6-sided polygon). Change sides = 6 to sides = 3 for a triangle, sides = 5 for a pentagon, sides = 8 for an octagon. The turning angle adjusts automatically.

What's new: Using variables to control the drawing, and a calculation (360 / sides) to figure out the right angle. This is the first project where the code is genuinely flexible: change one number and the shape changes completely.

Try this: What happens if you set sides = 100? The polygon has so many sides it looks like a circle. That is the entire trick to drawing circles in Turtle without using the circle() command.

Project 4: A Spiral

A spiral is a polygon where the side length grows each time:

import turtle

t = turtle.Turtle()
t.speed(0)

for length in range(5, 200, 5):
    t.forward(length)
    t.right(91)

turtle.done()

What this does: Draws a spiral that starts small and gets larger. The loop variable length takes the values 5, 10, 15, 20, ..., 195. Each iteration draws a slightly longer line, and the slightly off-90 angle (91 instead of 90) makes the spiral rotate as it grows. t.speed(0) makes the turtle draw at maximum speed.

What's new: A loop variable that does more than just count, it controls the actual length of each line. Small changes to the angle (try 89, 90, 91, 95, 120) produce wildly different spiral shapes.

Project 5: A Flower From Rotated Squares

This project starts looking genuinely impressive and is still simple code:

import turtle

t = turtle.Turtle()
t.speed(0)

for petal in range(36):
    for side in range(4):
        t.forward(100)
        t.right(90)
    t.right(10)

turtle.done()

What this does: Draws 36 squares, rotating 10 degrees between each one. The result is a flower-like rosette of overlapping squares. Each square uses the same loop pattern from Project 2, and the outer loop (36 iterations rotating by 10 degrees, totalling 360) wraps the rotation into a full circle.

What's new: A nested loop, where the inner loop draws one shape and the outer loop repeats and rotates the whole pattern. This is one of the most common patterns in generative art with Turtle.

Try this: Change the inner loop to draw triangles instead of squares (3 sides, 120-degree turns). Change the outer rotation from 10 degrees to other values (15, 20, 36). Each combination produces a different flower.

Project 6: A Recursive Fractal Tree

The most advanced project in this guide. It introduces recursion (a function that calls itself) but the result is genuinely beautiful:

import turtle

t = turtle.Turtle()
t.speed(0)
t.left(90)

def draw_tree(branch_length):
    if branch_length < 5:
        return
    t.forward(branch_length)
    t.right(20)
    draw_tree(branch_length - 15)
    t.left(40)
    draw_tree(branch_length - 15)
    t.right(20)
    t.backward(branch_length)

draw_tree(100)

turtle.done()

What this does: Draws a tree with branches that branch into smaller branches, recursively, until the branches are too small to draw. Each call to draw_tree draws the trunk, then calls itself twice to draw the right and left branches at smaller sizes.

What's new: Defining a function (def draw_tree(branch_length):) and recursion (the function calling itself). Recursion is genuinely advanced and many adults find it confusing the first time. Children who can grasp it through Turtle are doing real computer science work.

Try this: Change the angles (20 and 40 degrees) to produce more or less spread branches. Change the branch length reduction (15) to produce thinner or thicker trees. Change the cutoff (5) to make the tree more or less detailed.

Common Beginner Mistakes

A few patterns I see often when children first work with Turtle:

Forgetting turtle.done(). Without it, the window closes immediately and you cannot see the drawing. Always include it as the last line.

Indentation errors. Python is strict about indentation. The lines inside a for loop must all be indented the same amount (typically 4 spaces). Most editors handle this automatically, but a stray space can break the code.

Confusing degrees and pixels. forward(100) means 100 pixels. right(100) means 100 degrees. They are different units, and using a degree value where a pixel value belongs (or vice versa) produces strange shapes.

Not naming variables clearly. for i in range(36) is harder to read than for petal in range(36). Good names make code self-explanatory and easier to modify later.

Trying to do too much in one line. A complex Turtle program is much easier to read and debug when broken into many short lines, each doing one clear thing. Children who write one line per action and use clear variable names debug their own code more effectively than those who pack everything together.

A parent named Sarah Mitchell summarised what hands-on Python instruction feels like from the parent's seat: "EXCELLENT. Very hands-on. They actually teach concepts and have you apply them immediately. I highly recommend for anyone who wants to learn from ground zero." That "apply immediately" pattern is exactly what Turtle enables. Type, run, see, adjust, run again. The feedback loop is tight, which is what makes the learning stick.

FAQ

What age can kids start with Python Turtle?

Most children are ready to start Python Turtle between ages 10 and 13, ideally after a foundation in Scratch. Children aged 13+ with no prior coding experience can typically start Python Turtle directly because their abstract thinking is more developed and their typing is faster. Children under 10 usually do better starting with visual block coding first.

Do I need to install anything to use Python Turtle?

You need to install Python itself, which is free. The cleanest setup for beginners is Thonny, which includes Python and is designed specifically for new programmers. Turtle itself is built into Python, no separate installation is needed.

Is Python Turtle real Python or a simplified version?

Python Turtle uses standard Python syntax. The Turtle module is part of the official Python standard library. A child writing Turtle code is writing real Python that could be expanded into broader programming. The visual focus of Turtle is a teaching choice, not a simplification.

How long does it take to make a flower or spiral in Python Turtle?

Most children complete the square (Project 1) in 5 to 10 minutes, the polygon (Project 3) in 15 to 20 minutes, and the spiral (Project 4) in 20 to 30 minutes. The flower (Project 5) takes 30 to 45 minutes including experimentation with different shapes. The fractal tree (Project 6) typically takes a full session of 45 to 60 minutes including understanding recursion.

Can Python Turtle help kids learn for loops and functions?

Yes, exceptionally well. Loops in Turtle produce immediately visible results (a square becomes a hexagon by changing one number). Functions in Turtle let children define their own commands (like draw_square() or draw_tree()). The visual feedback makes abstract concepts concrete in a way that text-output Python rarely does.

What should my child do after they finish these Turtle projects?

Once a child is comfortable with all six projects, the natural next steps are: writing their own original drawings combining the techniques, exploring Turtle's colour and fill commands, or moving on to broader Python programming including text-based projects. For a structured progression, see our Python for kids complete guide.


Want a tutor's help guiding your child through Python Turtle and beyond? Book a free Discovery Call, 20 minutes, no obligation, and you'll leave with a clear plan for what to do next.

Enjoyed this article?

Your child can learn this and more with a dedicated 1-on-1 tutor.

Book a Free Discovery Call