CODEKALEIDOSCOPE

Creative Code. Colourful Thinking.

Lesson 4

Lesson 4 of 8

Lesson 4 - Loops and Kaleidoscope Patterns

Use loops to repeat Turtle commands and create symmetrical patterns.

Do Now — 5 mins Theory — 10 mins I Do — 5 mins We Do — 10 mins You Do — 20 mins Plenary — 5 mins

Lesson Journey

Use these stages to move from reading code to creating your own version.

  1. Predict
  2. Run
  3. Investigate
  4. Modify
  5. Make

Learning Aim

To use loops to repeat commands and build symmetrical Turtle patterns.

Defined End Point

By the end of this lesson, you will be able to use loops and repeat values to create a symmetrical Turtle pattern.

Key Vocabulary

looprepeatiterationrange

Do Now

Repetition Challenge

forward(100)
right(90)

forward(100)
right(90)

forward(100)
right(90)

forward(100)
right(90)
  1. What shape will this draw?
  2. What is repeated?
  3. How many times is it repeated?
  4. How could a loop make this shorter?

Stretch: Write the number of repeats needed.

Retrieval Practice

  • What does selection do?
  • What does an if statement check?
  • Why do we indent code inside a selection?

Theory

Predict how many circles will be drawn.

Read the code first. Do not run it yet.

for i in range(6):
    circle(40)
    right(60)

Prediction question

Why does the turtle turn 60 degrees each time?

I Do

Watch the Demonstration

Watch how repeated commands build a pattern without typing the same lines again and again.

Type this code into Mu Editor and run it.

from turtle import *

speed(0)
pencolor("cyan")
pensize(3)

for i in range(12):
    circle(50)
    right(30)

done()

Typing the code yourself helps build Python fluency and debugging skills.

We Do

Trace the loop and identify what is repeated.

Repeat count

What does range(12) control?

Repeated block

Which indented lines repeat?

Angle

What happens if right(30) changes?

You Do

Make small changes and test the pattern each time.

Change loop value
Change angle
Change colour
Change circle size

Workbook Activity

Create a kaleidoscope-style pattern using a loop.

Bronze

Repeat a circle 6 times.

Silver

Repeat a shape 12 times with colour.

Gold

Create a mandala using nested or combined loops.

WAGOLL

Example code and output.

Use the example to connect the Python instructions with the visual result.

Example code

from turtle import *

speed(0)
pencolor("cyan")
pensize(3)

for i in range(12):
    circle(50)
    right(30)

done()

Example Output

This WAGOLL uses a loop to repeat neatly and show clear symmetry.

Plenary

Explain what you learned and identify the next improvement you would make.

Extension task

Add a second loop to create a layered pattern.

Plenary question

How does a loop reduce repeated code?

Lesson Hub←  PreviousNext  →