Coding for Kids · Lesson

Drawing a Grid

Rows and columns.

Lesson 2 of 413 steps

Drawing a Grid is a free Coding for Kids lesson on CoddyKit. This is 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, and your progress syncs across the web and the CoddyKit app. The Coding for Kids course includes 4 lessons in total.

Grids Are Everywhere! 🟦

Hi builder! 👷 A grid is rows and columns, like a chessboard, graph paper, or a tile floor! 🟦🟦🟦

Today we use nested loops to draw our own grids. Let's go!

for row in range(3):
    print('A new row!')

Rows and Columns 📏

A grid has two parts:

  • Rows go side to side ↔️
  • Columns go up and down ↕️

The outer loop makes rows, the inner loop fills the columns!

for row in range(2):
    for col in range(4):
        print('o', end='')
    print()

The end='' Trick 🤫

Normally print jumps to a new line. To keep things on the SAME line, we add end=''. 🤫

Then we use an empty print() to jump down to the next row!

print('a', end='')
print('b', end='')
print('c')

A Tiny 2x2 Grid 🔲

Let's draw a grid with 2 rows and 2 columns. That's 4 little squares! 🔲🔲

for row in range(2):
    for col in range(2):
        print('#', end='')
    print()

Add Some Spaces 🌬️

If we put a space after each symbol, the grid looks neater and wider! 🌬️

Try print('#', end=' ') with a space inside the quotes.

for row in range(3):
    for col in range(3):
        print('#', end=' ')
    print()

A Big Wide Grid 🟩

Want a bigger grid? Just change the numbers in range()! More rows go down, more columns go across. 🟩🟩🟩🟩

for row in range(4):
    for col in range(8):
        print('@', end='')
    print()

Grid With Emojis! 😎

Who says grids have to be boring? Let's fill ours with emojis! 😎 Try frogs, stars, or hearts!

for row in range(3):
    for col in range(5):
        print('🐸', end='')
    print()

Numbered Grid 🔢

We can show the column number in each spot! This helps us SEE how the inner loop counts. 🔢

for row in range(2):
    for col in range(4):
        print(col, end=' ')
    print()

Checkerboard Idea ♟️

Real checkerboards switch colors! We can switch symbols too. For now, let's just keep one symbol — but imagine the possibilities! ♟️

for row in range(4):
    for col in range(4):
        print('■', end=' ')
    print()

Make It a Square 🟧

If rows and columns are the SAME number, you get a perfect square! Try 5 and 5. 🟧

size = 5
for row in range(size):
    for col in range(size):
        print('*', end='')
    print()

You Are a Grid Master! 🏆

Change size to any number and watch your square grow or shrink! 🏆

Try size 3, then size 7. Cool, right? Playing with numbers is the best! 🎮

size = 3
for row in range(size):
    for col in range(size):
        print('❤️', end='')
    print()

Quick Check! 🧠

Let's test your grid powers! 💪

Grid Champion! 🎉

Amazing work! 🎉 You can draw grids now!

  • Outer loop = rows (down) ↕️
  • Inner loop = columns (across) ↔️
  • end='' keeps stuff on one line 🤫
  • Empty print() jumps to a new row ⬇️

Next: triangles made of stars! ⭐

for row in range(3):
    for col in range(6):
        print('🟦', end='')
    print()
Free to start

Learn Python with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
35
Lessons
140

Frequently Asked Questions

Is the “Drawing a Grid” lesson free?

Yes — the full text of “Drawing a Grid” is free to read here on the web. 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. The Coding for Kids course includes 4 lessons in total.

What will I learn in “Drawing a Grid”?

Rows and columns. 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, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 4.

How long does the “Drawing a Grid” 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. A Loop Inside a Loop
  2. Drawing a Grid
  3. Star Triangles
  4. Multiplication Table
← Back to Coding for Kids