🤖 Python Grade 5 · session 6 of 12 · 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.

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. 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.

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.

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)
for i in range(4):
    print("Python is fun!")
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)
for i in range(1, 6):
    print(i)
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)
for n in range(1, 11):
    print(f"5 x {n} = {n * 5}")
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)
for i in range(1, 6):
    print("*" * i)
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)
total = 0
for n in range(1, 101):
    total += n
print(f"Total: {total}")

🎁 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