Skip to content
Computing · Year 10

Active learning ideas

Iteration: Fixed Loops (For)

Active learning works especially well for fixed loops because students need to see iteration in action to grasp how the loop variable changes and how it controls repetition. Constructing loops themselves, rather than just reading about them, helps students internalize the relationship between the range or list and the number of passes the loop makes.

National Curriculum Attainment TargetsGCSE: Computing - Programming Fundamentals
30–45 minPairs → Whole Class4 activities

Activity 01

Stations Rotation35 min · Pairs

Pair Programming: Star Patterns

Pairs start with a 'for' loop using range(6) to print rows of stars, adding a nested loop for triangle shapes. They modify to print numbers or letters, test outputs, and explain changes to the class. Swap roles midway for balanced participation.

Explain scenarios where a 'for' loop is the most appropriate iteration construct.

Facilitation TipDuring Pair Programming: Star Patterns, circulate and ask each pair to verbally explain their loop’s start, stop, and step before they run the code.

What to look forPresent students with a simple list of numbers (e.g., [5, 10, 15, 20]). Ask them to write a 'for' loop that prints each number multiplied by 2. Observe their syntax and understanding of iteration.

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Stations Rotation45 min · Small Groups

Small Groups: Efficiency Comparison

Groups write code to print or sum 500 times manually via copy-paste, then refactor with a 'for' loop. Time both methods, graph results, and discuss why loops win for larger scales. Extend to process random lists.

Construct a 'for' loop to process elements in a list or array.

Facilitation TipIn Small Groups: Efficiency Comparison, give each group a printed table to fill in as they time and compare manual repetition versus loops.

What to look forAsk students to write one sentence explaining a situation where a 'for' loop would be better than writing the same code 100 times. Then, have them write a 'for' loop that counts down from 10 to 1.

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Stations Rotation30 min · Whole Class

Whole Class: Debug Relay

Display code with 'for' loop errors like off-by-one on the board or shared screen. Students take turns suggesting fixes, run in an online IDE, and vote on the correct version. Debrief common issues as a group.

Compare the efficiency of a 'for' loop versus manual repetition for a large number of iterations.

Facilitation TipFor Whole Class: Debug Relay, prepare sticky notes with line numbers so students can physically move between stations to find and fix errors.

What to look forPose the question: 'Imagine you need to add up 1000 numbers. Which is more efficient and less error-prone: writing 1000 addition lines or using a 'for' loop? Explain your reasoning, considering both time and accuracy.' Facilitate a class discussion on their answers.

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Stations Rotation40 min · Individual

Individual: List Challenges

Each student codes 'for' loops to find max value, average, or reverse a list of scores. Test with 3 datasets, add print statements for tracing, and self-assess against rubrics. Share one strong example.

Explain scenarios where a 'for' loop is the most appropriate iteration construct.

Facilitation TipDuring Individual: List Challenges, provide a starter code template with comments that guide the loop structure to reduce syntax errors.

What to look forPresent students with a simple list of numbers (e.g., [5, 10, 15, 20]). Ask them to write a 'for' loop that prints each number multiplied by 2. Observe their syntax and understanding of iteration.

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Teachers should model tracing loops on paper first, using arrows or boxes to show how the loop variable updates each pass. Avoid rushing to the keyboard; insist students sketch the loop’s behavior before coding. Research shows that students who trace loops manually before writing code make fewer off-by-one errors and understand scope more clearly.

By the end of these activities, students should write correct ‘for’ loop syntax for given tasks, explain why a ‘for’ loop is the right choice over repetition, and trace loop execution to predict outputs. They should also justify their choice of loop parameters like start, stop, and step values.


Watch Out for These Misconceptions

  • During Pair Programming: Star Patterns, watch for students assuming range always starts at 1 and increments by 1.

    Have students trace their pattern on paper first, marking each position with the loop variable’s value to confirm start and step values before coding.

  • During Small Groups: Efficiency Comparison, watch for students believing range(10) iterates 10 times from 10 to 19.

    Ask each group to print the loop variable inside the loop and compare outputs to the expected count of 0 to 9, reinforcing the off-by-one concept.

  • During Whole Class: Debug Relay, watch for students thinking loop variables keep their last value after the loop ends.

    Instruct students to add a print statement right after the loop to show the variable’s value, then discuss why it resets or retains based on scope.


Methods used in this brief