0Pricing
Coding for Kids · Lesson

Star Triangles

Grow patterns.

Triangles of Stars! ⭐

Hi artist! 🎨 Today we draw triangles made of stars that grow bigger row by row! ⭐

Like this:

  • *
  • **
  • ***

Let's learn the magic!

print('*')
print('**')
print('***')

Growing Rows 📈

See how each row has MORE stars? Row 1 has 1, row 2 has 2, row 3 has 3. 📈

The trick: the inner loop runs a DIFFERENT number of times for each row!

for row in range(3):
    print('Row', row, 'needs', row + 1, 'stars')

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