🤖 Python Grade 5 · session 6 of 44 · 60 minutes · 🎁 free with an account

Loops and turtle art

Why type something 100 times? Tell Bolt to repeat it! Today you'll print patterns, make times tables and draw colourful art with a turtle.

Illustration of a cute pastel robot dancing
Illustration: andremsdesign / Pixabay

A complete lesson · 60 minutes

Teach it, see it, practise it, all on this page.

Open this page with your learner and work down it, or press Teach this lesson to go through it one step at a time on a big screen. Every section has something to do.

  1. Warm-up3 min
  2. Warm-up games5 min
  3. for and range(): repeat it9 min
  4. Meet the turtle9 min
  5. Loops + turtle = art9 min
  6. Times table machine7 min
  7. Countdown and pattern7 min
  8. Turtle flower5 min
  9. Quiz5 min
  10. Set the after-class project1 min

By the end you can

  • Repeat lines with for and range()
  • Use the loop number in sums
  • Draw shapes with turtle
  • Use a loop to make turtle art

Before you start

  • Lesson 1: print()
  • Lesson 3: variables and f-strings

Have ready

  • This page
  • Coloured pencils for planning a drawing (optional)

Grade 5 · ages 10 and 11 · no experience needed

Warm-up · think first

Walk a square: go forward 3 steps and turn right. How many times do you repeat that to get back to the start?

Show the answer

4 times. Four sides and four turns. Soon you'll tell a turtle to do exactly this in 3 lines.

Teacher tip: Have a learner walk it for real.

More warm-ups for every class →

🎮 Warm-up games · 5 quick games

Play with Bolt the robot

Five minutes with Bolt the robot. Vote, say why, then show the answer.

  1. Which of these is not a loop in real life? (Days of the week · A song's chorus · Eating one apple · Hands going round a clock)
    Answer: "Eating one apple" happens once. The others repeat over and over.
  2. Would you rather write your name 100 times by hand, or write one line of code? (By hand · One line of code)
    Answer: One line! That's why loops are a superpower.
  3. range(5) counts 1, 2, 3, 4, 5. (Always · Sometimes · Never)
    Answer: Never — Never. It counts 0, 1, 2, 3, 4: five numbers, starting at 0.
  4. To draw a triangle, a turtle goes forward, then turns. How many degrees must it turn each time?
    Answer: 120. It turns 360 degrees in all, over 3 corners, and 360 ÷ 3 is 120.
  5. What could you draw with only straight lines and turns?
    Answer: Houses, stars, spirals, robots! Plan one for the project.

Three levels, like a real engineer

Use it. Tweak it. Build it.

First use what the lesson shows exactly as it is, then change one key thing and see what happens, then make your own.

  1. 🔒

    Level 1 · Use it

    Run the Square Code

    Run the lesson's square turtle art code with for i in range(4). Watch the turtle draw a shape and see what each loop turn makes.

  2. 🔧

    Level 2 · Tweak it

    Change the Loop Number

    Change range(4) to range(6) or change the turn angle. Predict the new turtle art, then run it and check.

  3. 🛠️

    Level 3 · Build it

    Build Your Turtle Art

    Make your own turtle art loop. Pick a shape or spiral, write a for loop with range, and test your design.

Part 1 of 3 · learn, see, practise

for and range(): repeat it

Listen to this part

Tell me once and I'll repeat it for ever! A for loop runs the moved-in lines again and again, and i tells you which time it is.

for i in range(5): runs the moved-in lines 5 times. It needs a colon and 4 spaces, like if.

i holds the count, starting at 0: 0, 1, 2, 3, 4.

range(1, 6) counts 1, 2, 3, 4, 5: it stops just before the last number.

🧑‍🏫 Teacher: type this live with the class

Bolt repeats

  1. for i in range(3):

    A colon, like if. Press Enter and see the indent. Say: repeat 3 times.

  2. print("Hip hip hooray!")

    Run it. Change 3 to 30!

  3. for i in range(1, 6):

    A new loop, back on the left. Ask: what will it count?

  4. print(i)

    Run it. Notice it stops before 6.

  5. print("Blast off!")

    Not moved in, so it happens once, after the loop.

Type here

▶ Output

(nothing is printed)

📦 Memory boxes

No variables yet
Example: run it, then change it

▶ Output

⭐
⭐⭐
⭐⭐⭐
⭐⭐⭐⭐
⭐⭐⭐⭐⭐
1 x 7 = 7
2 x 7 = 14
3 x 7 = 21
4 x 7 = 28
5 x 7 = 35

📦 Memory boxes

i5intn5int

A growing star pattern and a times table, in four lines. Change 7 to your favourite number.

Puzzle break: count like Python

Python starts counting at 0. Count on your fingers as you read.

  1. Puzzle 1: say what happens before you run it
  2. Puzzle 2: fill the gap
  3. Puzzle 3: find the bug

Practise it

Start with the warm-up and go as far as you can. The stretch questions are meant to be hard.

Warm-up

1.1 Print Python is fun! 4 times with a loop.

Task 1.1

▶ Output

(nothing is printed)

📦 Memory boxes

No variables yet
🧑‍🏫 Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 2 lines the student writes

for i in range(4):    print("Python is fun!")

What it prints

Python is fun!
Python is fun!
Python is fun!
Python is fun!

What ✓ Check looks for

  • it prints exactly:
    Python is fun!
    Python is fun!
    Python is fun!
    Python is fun!
  • In the code: Use a for loop.
Warm-up

1.2 Print the numbers 1 to 5 with a loop.

Task 1.2

▶ Output

(nothing is printed)

📦 Memory boxes

No variables yet
🧑‍🏫 Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 2 lines the student writes

for i in range(1, 6):    print(i)

What it prints

1
2
3
4
5

What ✓ Check looks for

  • it prints exactly:
    1
    2
    3
    4
    5
  • In the code: Use range().
Core

1.3 Print the 5 times table from 5 x 1 = 5 up to 5 x 10 = 50.

Task 1.3

▶ Output

(nothing is printed)

📦 Memory boxes

No variables yet
🧑‍🏫 Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 2 lines the student writes

for n in range(1, 11):    print(f"5 x {n} = {n * 5}")

What it prints

5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50

What ✓ Check looks for

  • it prints exactly:
    5 x 1 = 5
    5 x 2 = 10
    5 x 3 = 15
    5 x 4 = 20
    5 x 5 = 25
    5 x 6 = 30
    5 x 7 = 35
    5 x 8 = 40
    5 x 9 = 45
    5 x 10 = 50
  • In the code: Use a loop.
Core

1.4 Print a growing stair of stars, with 1, 2, 3, 4 and then 5 stars.

Task 1.4

▶ Output

(nothing is printed)

📦 Memory boxes

No variables yet
🧑‍🏫 Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 2 lines the student writes

for i in range(1, 6):    print("*" * i)

What it prints

*
**
***
****
*****

What ✓ Check looks for

  • it prints exactly:
    *
    **
    ***
    ****
    *****
  • In the code: Use a loop.
Stretch 🔥

1.5 Add up the numbers 1 to 100. Start with total = 0, add each number in a loop, then print exactly: Total: 5050

Task 1.5

▶ Output

(nothing is printed)

📦 Memory boxes

total0int
🧑‍🏫 Model answer (for the teacher)

Teacher eyes only: hide the answers before you share your screen.

The answer green = the 3 lines the student writes

total = 0for n in range(1, 101):    total += nprint(f"Total: {total}")

What it prints

Total: 5050

What ✓ Check looks for

  • it prints exactly:
    Total: 5050
  • In the code: Add to total with +=.
  • In the code: Use a loop.

🎁 Free for a year

Make a free account to open the rest of this lesson

Every new account opens every lesson of every course free for a whole year: no payment, no card, nothing to cancel.

Unlocking the rest of this lesson gives you:

  • Part 2: Meet the turtle, with practice at three levels
  • Part 3: Loops + turtle = art, with practice at three levels
  • Class activity 1: Times table machine
  • Class activity 2: Countdown and pattern
  • Class activity 3: Turtle flower
  • A 8-question quiz
  • After-class project: My turtle art gallery
  • Homework and a printable practice sheet with answers
  • Teach mode and the minute-by-minute teacher's plan

It takes a minute. Anyone under 13 signs up with a parent. The first 2 lessons of every course, every game and all maths practice stay free.

FAQ

Loops and turtle art: questions

What is a for loop in simple words?

An instruction to repeat some lines. It saves you writing the same thing many times.

What is Python turtle?

A little drawing tool in Python. You give it moves and turns, and it draws lines. On this page, it draws right below your code.

Why does range start at 0?

Python counts from 0 by habit. Use range(1, 11) if you want 1 to 10.

Start a conversation

Want a teacher to take this class?

Tell us the learner's age and level. A teacher from our network teaches with these lessons; we confirm timing and price first.

  • Tell us the learner’s age or grade and goals
  • We’ll suggest a suitable class or learning path
  • We’ll confirm format, timing and fees with a parent or guardian

For a child’s class, please have a parent or guardian send the enquiry. Avoid sharing passwords or sensitive personal details.

We’ll use your details only to respond to this request.

Chat on WhatsApp
Esc

Try