Year 8 · Computing · Python: loops · Lesson 1
For loops
Python for loops: iteration, range with start, stop and step, the loop variable, the colon and indentation.

19-minute video lesson
Teaching, worked examples and 20 practice questions solved step by step.
Watch free for a monthWhat your child will learn
- Explain iteration
- Use range with one, two and three numbers
- Predict the output of a for loop
- Use indentation correctly
- Write for loops
The method
- Find the range: start, stop, step.
- List the loop variable's values.
- Run the indented lines for each value.
- Run unindented lines once after.
Key words: loop, iteration, for, range, indentation, variable, count-controlled.
Worked examples
The first three practice questions from the lesson, with every step.
Question 1
What is iteration?
- Step 1: Repeating code
Answer: Repeating code using a loop
Question 2
How many times does for i in range(4) repeat?
- Step 1: 0, 1, 2, 3
Answer: 4 times
Question 3
What values does range(3) give?
- Step 1: Start 0, stop before 3
Answer: 0, 1, 2