Lesson 4: Using loops in Python

Children use loops in Python to create their own pieces of Islamic art, tinkering with different values to create different shapes.

Before the lesson

Download classroom resources

Learning objective

  • To use loops when programming

National curriculum

Pupils should be able to:

  • Use sequence, selection, and repetition in programs; work with variables and various forms of input and output
  • Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts

Success criteria

Cross-curricular links

Attention grabber

Main event


Pupils needing extra support: Give them this ‘Activity: Repeated circle design program’, encouraging them to experiment with it, changing the numbers to see what they can create.

Or get them to use Scratch to build repeating patterns to support children who struggle managing written code, using the ‘Scratch – Islamic Art example’ to help.


Pupils working at greater depth: Encourage them to use embedded loops to create each of their rows.

Wrapping up

Assessing pupils' progress and understanding


Created by:
Sway Grantham,  
Computing specialist
Sway Grantham (@SwayGrantham) is a Primary School Teacher, a CAS Master Teacher and Specialist Leader in Education for Primary ICT. She also has a BCS Certificate in Computer Science Teaching (Primary). She has written several curricula and conducted research into the…
Find out more