0Pricing
Coding for Kids · Lesson

Filling Shapes

Fill with color.

Filling Shapes is a free Coding for Kids lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Coding for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Let's Fill Shapes With Color! 🪣🎨

An empty shape is just an outline. ⬜ But what if we could POUR color inside it? 🪣

The turtle can fill shapes with color, like coloring inside the lines in a coloring book! 🖍️

import turtle

t = turtle.Turtle()
t.forward(80)

The Magic Words: begin_fill

To start filling, we say t.begin_fill() BEFORE we draw the shape.

This tells the turtle: 'Get ready to fill what I draw next!' 🪣

import turtle

t = turtle.Turtle()
t.begin_fill()
t.forward(80)

And end_fill to Finish

After we finish drawing the shape, we say t.end_fill().

Now the turtle pours the color inside! 🎉 You need BOTH begin and end to fill.

import turtle

t = turtle.Turtle()
t.begin_fill()
t.forward(80)
t.right(120)
t.forward(80)
t.right(120)
t.forward(80)
t.end_fill()

Pick the Fill Color

What color fills the shape? Use t.fillcolor('yellow')! 💛

Set the fill color before begin_fill(), and your shape fills with that color.

import turtle

t = turtle.Turtle()
t.fillcolor('yellow')
t.begin_fill()
t.forward(80)
t.right(120)
t.forward(80)
t.right(120)
t.forward(80)
t.end_fill()

A Solid Red Square 🟥

Let's fill a square! A square has 4 equal sides and turns of 90 degrees.

We pick red, begin fill, draw all 4 sides, then end fill. Boom! A solid red square! ❤️

import turtle

t = turtle.Turtle()
t.fillcolor('red')
t.begin_fill()
t.forward(90)
t.right(90)
t.forward(90)
t.right(90)
t.forward(90)
t.right(90)
t.forward(90)
t.end_fill()

Outline AND Fill Together

You can have a different outline color and fill color!

Use t.color('blue', 'orange'). The first is the outline (blue) and the second is the fill (orange)! 🔵🟠

import turtle

t = turtle.Turtle()
t.color('blue', 'orange')
t.begin_fill()
t.forward(90)
t.right(120)
t.forward(90)
t.right(120)
t.forward(90)
t.end_fill()

A Filled Circle ⚫

The turtle can draw a circle with t.circle(50). The number is how big it is!

Wrap it in begin_fill and end_fill to make a colorful dot! 🟣

import turtle

t = turtle.Turtle()
t.fillcolor('purple')
t.begin_fill()
t.circle(50)
t.end_fill()

Fill Must Be a Closed Shape

Filling works best when the shape is closed (all the way around). 🔁

If the shape has a gap, the turtle still tries to fill it, but it might look funny! Always finish your shape. ✅

import turtle

t = turtle.Turtle()
t.fillcolor('green')
t.begin_fill()
t.circle(40)
t.end_fill()

A Green Star ⭐

Stars are easy! Move forward, then turn 144 degrees, 5 times.

Fill it with gold and you get a shiny star! 🌟

import turtle

t = turtle.Turtle()
t.fillcolor('gold')
t.begin_fill()
t.forward(100)
t.right(144)
t.forward(100)
t.right(144)
t.forward(100)
t.right(144)
t.forward(100)
t.right(144)
t.forward(100)
t.end_fill()

Two Filled Shapes

Want more than one filled shape? Just begin_fill and end_fill again for each shape! 🎨

Lift the pen with t.penup() to move without drawing, then t.pendown() to draw again.

import turtle

t = turtle.Turtle()
t.fillcolor('red')
t.begin_fill()
t.circle(30)
t.end_fill()
t.penup()
t.forward(100)
t.pendown()
t.fillcolor('blue')
t.begin_fill()
t.circle(30)
t.end_fill()

Your Turn to Fill! 🎉

Now YOU pick the color! Change 'pink' to your favorite color and run it. 🩷

Try making it a circle or a square. You are the artist! 🖌️

import turtle

t = turtle.Turtle()
t.fillcolor('pink')
t.begin_fill()
t.forward(90)
t.right(90)
t.forward(90)
t.right(90)
t.forward(90)
t.right(90)
t.forward(90)
t.end_fill()

Quick Check ✅

Let's see what you remember! 🧠

Filled With Fun! 🎨🎉

Great job, color master! Today you learned:

  • t.fillcolor('yellow') picks the fill color 💛
  • t.begin_fill() starts filling 🪣
  • t.end_fill() pours the color in 🎉
  • Fill works best on closed shapes

Next: draw LOTS of shapes! 🔺🟦⭐

Frequently asked questions

Is the “Filling Shapes” lesson free?

Yes — the full text of “Filling Shapes” is free to read here on the web, and the Coding for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO.

What will I learn in “Filling Shapes”?

Fill with color. You practise Coding for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Coding for Kids?

No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Filling Shapes” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Coding for Kids lesson?

Yes. Every Coding for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Turtle Colors
  2. Filling Shapes
  3. Many Shapes
  4. A Colorful Pattern
← Back to Coding for Kids