Python fun for Kids ! Intresting isnt it ?
Dear Parents,
What if your kid could draw a picture just by telling the computer what to do? That’s exactly what Python’s Turtle graphics library lets them do. No boring theory, no confusing setup — just a little digital turtle carrying a pen, walking around the screen, and drawing wherever it goes.
If your child enjoyed our Python for Kids introduction, this is the perfect next step — because now they get to see their code come to life.
Hey kids! 🐢 Ready to meet your new coding pet? This little turtle listens to everything you tell it — walk forward, turn left, turn right — and leaves a colorful trail behind. By the end of this tutorial, you’ll have drawn a square, a star, and a rainbow spiral, all with your own code!
What Is Turtle Graphics?
Imagine a tiny robot turtle standing in the middle of a whiteboard, holding a pen. You can give it simple instructions:
- “Walk forward 100 steps”
- “Turn right”
- “Walk forward again”
As the turtle moves, it drags its pen along the whiteboard, leaving a line behind it. That’s it — that’s the whole idea! By combining lots of small movements, you can draw squares, stars, spirals, and almost anything else you can imagine.
In Python, this “robot turtle” is a built-in tool called the turtle module. It’s one of the best ways for kids to learn programming, because every line of code has a visible result.
Getting Set Up
Turtle comes built into Python, so there’s nothing extra to install. Just open your Python editor (IDLE, or whatever your child has been using) and start with this line at the top of every turtle program:
import turtle
This tells Python, “Hey, we want to use the turtle tools!”
Meeting Your Turtle
Let’s create our turtle and give it a name:
import turtlet = turtle.Turtle()
Now t is our turtle, sitting right in the middle of the screen, facing right, pen down and ready to draw.
The Turtle’s Basic Moves
Here are the main commands your child will use constantly:
| Command | What it does |
|---|---|
t.forward(100) | Walks forward 100 steps |
t.backward(50) | Walks backward 50 steps |
t.right(90) | Turns right by 90 degrees |
t.left(90) | Turns left by 90 degrees |
t.penup() | Lifts the pen (moves without drawing) |
t.pendown() | Puts the pen back down (draws again) |
t.pencolor("red") | Changes the trail color |
Kid-friendly analogy: Think of it like giving directions to a friend who’s blindfolded. You can only say “walk forward,” “turn left,” or “turn right” — nothing else. Turtle graphics is basically a game of directions, except your friend is a turtle, and it leaves a trail of paint behind it!
Example 1: Draw a Square
Let’s draw the simplest shape there is — a square. A square has 4 equal sides and 4 corners, and at each corner you turn exactly 90 degrees.
import turtlet = turtle.Turtle()t.pencolor("navy")t.pensize(6)for _ in range(4): t.forward(200) t.right(90)turtle.done()
What’s happening here?
for _ in range(4):tells Python “do this 4 times” — once for each side of the square- Each time through the loop, the turtle walks forward 200 steps, then turns right 90 degrees
- After 4 sides and 4 turns, the turtle ends up right back where it started — and a perfect square appears!
Result:

Ask your kid: “What do you think would happen if we changed range(4) to range(3)?” (Answer: a triangle — because turning 90° three times won’t quite close the shape the same way. This is a great moment to let them experiment and see what happens!)
Example 2: Draw a Star ⭐
Now let’s make things more exciting. A 5-pointed star uses the same idea — forward and turn — just with a different turning angle.
import turtlet = turtle.Turtle()t.pencolor("deeppink")t.pensize(6)for _ in range(5): t.forward(250) t.right(144)turtle.done()
Why 144 degrees? This is the fun math secret behind stars! To draw a 5-pointed star, the turtle needs to turn 144 degrees at each point. Older kids can discover this themselves with the formula 360 ÷ 5 × 2 = 144. Younger kids can just enjoy that a “magic number” makes a star appear!
Result:

Challenge for kids: Try changing range(5) to range(6) and the turn angle to 120. What shape do you get instead? (Hint: it’s not a star anymore!)
Example 3: A Rainbow Spiral 🌈
This is where turtle graphics gets really fun. Let’s combine a loop, a growing distance, and changing colors to make something that looks almost magical.
import turtlet = turtle.Turtle()t.pensize(4)t.speed(0)colors = ["deeppink", "gold", "mediumspringgreen", "steelblue", "purple"]for i in range(100): t.pencolor(colors[i % len(colors)]) t.forward(i * 3) t.right(59)turtle.done()
Breaking it down for kids:
colors[i % len(colors)]picks a new color from our list every time, cycling back to the start once we run out — this is what makes the rainbow effectt.forward(i * 3)means the turtle walks a little further each time through the loop, which is why the spiral grows bigger and biggert.right(59)turns the turtle by a slightly odd angle, which is what creates the swirly, flower-like pattern instead of a plain circle
Result:

This one usually gets the biggest “whoa!” from kids — and it’s a great example of how just a few lines of code can create something that looks really complicated.
Why Turtle Graphics Is Great for Kids Learning to Code
- Instant feedback: Every change to the code changes the picture immediately — no abstract concepts, just cause and effect
- Teaches real programming ideas: loops, angles, variables, and lists — all hiding inside something that feels like play
- Encourages experimentation: kids naturally want to tweak numbers and see what happens, which is exactly how good programmers learn
- Builds confidence: finishing a drawing feels like an accomplishment, not just “finishing an exercise”
Fun Challenges to Try Together
Once your child is comfortable with the examples above, try these:
- Color swap: Change the square’s color to their favorite color
- Bigger star: Make the star’s sides 400 steps instead of 250
- Shape mashup: Draw a square, then use
penup()andgoto()to move the turtle, then draw a star next to it - Name art: Use
t.write("YOUR NAME")to have the turtle sign its artwork
What’s Next?
Now that your child has drawn shapes with code, they’re ready to start combining these ideas into their own creations — houses, flowers, robots, anything they can imagine as a series of forward-and-turn steps. If they enjoyed this, check out our Python for Kids beginner guide to keep building their Python foundations alongside more turtle art.
Have your kids try these examples and share what they drew in the comments below! We’d love to see their creations.





Leave a Reply