Drawing Patterns
Print stars and shapes with loops.
Drawing Patterns is a free Coding for Kids lesson on CoddyKit. This is lesson 4 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.
Drawing with Code! 🎨
Hello, code artist! 🖌️ Today we draw cool patterns using loops and stars! ⭐ Get ready to make art with Python! 🎉
Printing a Star ⭐
First, let us print a single star. We use "*" as our star shape!
print("*")A Row of Stars ➡️
We can repeat stars! In Python, "*" * 5 makes five stars in a row!
print("*" * 5)Stars Times a Number ✖️
The trick "*" * 3 means "repeat the star 3 times". Magic multiplication for strings! 🪄
print("*" * 3)
print("*" * 7)A Square of Stars 🟦
Use a loop to print the same row many times. This makes a square!
for i in range(4):
print("*" * 4)A Growing Triangle 📐
Here is the cool part! Use the counter i to make each row LONGER. A triangle appears! 🔺
for i in range(5):
print("*" * i)Add One for a Bigger Triangle ➕
Start with one star by using i + 1. Now the triangle starts bigger!
for i in range(5):
print("*" * (i + 1))Use Any Symbol! 💫
Stars are fun, but you can use ANY symbol! Try hashes.
for i in range(4):
print("#" * (i + 1))A Row of Hearts 💖
Let us make a row of hearts. So pretty!
print("💖" * 5)Shrinking Triangle 🔻
Count down to make the triangle get SMALLER! Use a while loop.
n = 5
while n > 0:
print("*" * n)
n = n - 1You Are a Code Artist! 🎉
Wonderful! Try drawing a triangle of 3 rows with your favorite symbol.
for i in range(3):
print("⭐" * (i + 1))Quick Check 🧠
Quiz time! 🎯 What does "*" * 3 make?
Recap Time! 🌟
Beautiful work, artist! 🎓 Today you learned:
"*" * 5repeats a symbol- Loops draw many rows
- Use the counter
ito grow patterns - Any symbol works: stars, hearts, hashes!
You are a pattern-drawing pro! 🎨
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 Patterns” lesson free?
Yes — the full text of “Drawing Patterns” 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 Patterns”?
Print stars and shapes with loops. 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 4 of 4.
How long does the “Drawing Patterns” 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
- Why Loops Are Awesome
- Counting with for
- Repeating with while
- Drawing Patterns