0Pricing
Coding for Kids · Lesson

Doors and Windows

Add details.

Doors and Windows is a free Coding for Kids lesson on CoddyKit — lesson 3 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.

Add Doors and Windows! 🚪🪟

Our house has walls and a roof, but how do we get inside? 🤔 We need a DOOR!

And to see outside, we need WINDOWS! Let's add the details today. 🏠✨

import turtle

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

Move Without Drawing 🖊️⬆️

To put a door in the right spot, we move WITHOUT drawing a line.

t.penup() lifts the pen. t.goto(x, y) jumps to a spot. t.pendown() starts drawing again! ✈️

import turtle

t = turtle.Turtle()
t.penup()
t.goto(50, 0)
t.pendown()
t.forward(40)

A Door Is a Small Rectangle 🚪

A door is a tall, thin rectangle. It has 2 long sides and 2 short sides.

We draw: up, across, down, across. Let's make a door! 🚪

import turtle

t = turtle.Turtle()
t.left(90)
t.forward(60)
t.right(90)
t.forward(30)
t.right(90)
t.forward(60)

Color the Door Brown 🟤

Doors are usually wood, so let's make ours brown! 🪵

Use fillcolor('brown') with begin_fill() and end_fill() around the door.

import turtle

t = turtle.Turtle()
t.fillcolor('brown')
t.begin_fill()
t.left(90)
t.forward(60)
t.right(90)
t.forward(30)
t.right(90)
t.forward(60)
t.right(90)
t.forward(30)
t.end_fill()

A Window Is a Small Square 🪟

A window is a little square. 4 equal sides, just smaller than the house!

We use a loop: for i in range(4): with a small forward.

import turtle

t = turtle.Turtle()
for i in range(4):
    t.forward(30)
    t.left(90)

Make the Window Blue 💙

Windows look like glass, so let's fill them light blue! 🪟

Use fillcolor('lightblue'). The glass sparkles! ✨

import turtle

t = turtle.Turtle()
t.fillcolor('lightblue')
t.begin_fill()
for i in range(4):
    t.forward(30)
    t.left(90)
t.end_fill()

Place the Window With goto 📍

To put a window in the right spot, we use penup(), then goto(x, y), then pendown().

The numbers tell the turtle exactly WHERE to go. Left-right is x, up-down is y! 🗺️

import turtle

t = turtle.Turtle()
t.penup()
t.goto(20, 50)
t.pendown()
t.fillcolor('lightblue')
t.begin_fill()
for i in range(4):
    t.forward(30)
    t.left(90)
t.end_fill()

Two Windows! 🪟🪟

Let's add a window on each side! We draw one, move over, and draw another.

Reuse the same window code, just goto a different spot first! 📍

import turtle

t = turtle.Turtle()
t.fillcolor('lightblue')
for x in [-60, 40]:
    t.penup()
    t.goto(x, 50)
    t.pendown()
    t.begin_fill()
    for i in range(4):
        t.forward(30)
        t.left(90)
    t.end_fill()

Add a Window Cross ➕

Real windows have a cross in the middle! Let's add one line across and one up.

It splits the window into 4 little panes. So detailed! 🪟

import turtle

t = turtle.Turtle()
t.fillcolor('lightblue')
t.begin_fill()
for i in range(4):
    t.forward(40)
    t.left(90)
t.end_fill()
t.penup()
t.goto(20, 0)
t.pendown()
t.goto(20, 40)

A Doorknob! 🔘

Every door needs a doorknob to open it! 🚪

We draw a tiny filled circle. Use t.dot(8, 'gold') for a quick golden knob! ✨

import turtle

t = turtle.Turtle()
t.fillcolor('brown')
t.begin_fill()
for i in range(4):
    t.forward(40)
    t.left(90)
t.end_fill()
t.penup()
t.goto(35, 20)
t.dot(8, 'gold')

Design Your Own Door! 🚪🎨

Your turn! Make a door in YOUR favorite color. 🤩

Change 'purple' to any color and pick where to put the gold doorknob! 🔘

import turtle

t = turtle.Turtle()
t.fillcolor('purple')
t.begin_fill()
t.left(90)
t.forward(60)
t.right(90)
t.forward(30)
t.right(90)
t.forward(60)
t.right(90)
t.forward(30)
t.end_fill()

Quick Check ✅

Detail brain teaser! 🧠🚪

Doors and Windows Done! 🚪🪟🎉

Fantastic! Your house has details now! You learned:

  • penup() and pendown() to move without drawing ✈️
  • goto(x, y) to jump to a spot 📍
  • A door is a rectangle, a window is a small square 🟫🟦
  • t.dot(8, 'gold') makes a doorknob 🔘

Next: add a sun and sky to finish the scene! ☀️

Frequently asked questions

Is the “Doors and Windows” lesson free?

Yes — the full text of “Doors and Windows” 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 “Doors and Windows”?

Add details. 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 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Doors and Windows” 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. Drawing a Square House
  2. Adding a Roof
  3. Doors and Windows
  4. A Sun and Sky
← Back to Coding for Kids