AQA GCSE Computer Science June 2025 Paper 1, Question 1: tracing a while loop

AQA 8525 June 2025 Paper 1, Question 1: find the first arithmetic operation, the false statement and the relational operator in a short Python program, then trace its while loop, which doubles a each pass. The full table and the program to run.

Past paper questionAQA 8525/1BJune 2025 Paper 17 marksTrace table

Question 1 of the AQA GCSE Computer Science Paper 1 sat on 12 May 2025 (8525/1B, the Python paper) is about an eight line Python program. Three one mark parts test vocabulary, and then there is a trace table worth 4 marks.

We do not copy the exam paper here. Open it beside this page: AQA June 2025 Paper 1B question paper (PDF). When you have finished, check the mark scheme too.

The question in short

Line 1 is a comment. Lines 2 to 4 set a to 1, b to 1 and c to 5. Line 5 starts a loop: while b < c. Inside it, line 6 is a = a + a, line 7 adds 1 to b, and line 8 prints a.

Parts 1 to 3

1.1 Where is an arithmetic operation first used? Line 6, a + a. Line 5 compares. It does not calculate.

1.2 Which statement is false? "This program uses concatenation." Concatenation joins strings. a + a here adds numbers. The program does have a comment (line 1), assignment and iteration.

1.3 The relational operator. < (less than), on line 5. = is rejected: in Python a single equals sign assigns.

Part 4: the trace table

a + a doubles a. Each pass doubles a, adds 1 to b, then prints.

a b c Output
1 1 5
2 2 2
4 3 4
8 4 8
16 5 16

When b reaches 5, b < c is false and the loop ends. Four passes.

The four marks: the three starting values; the first output, 2; the rest of a and the rest of the outputs; the rest of b. Any error caps it at 3.

Where the marks are lost

  • Adding 1 to a. a + a is doubling: 1, 2, 4, 8, 16, not 1, 2, 3, 4, 5.
  • A fifth pass. When b is 5, is 5 less than 5? No. The loop stops. 32 never appears.
  • Writing 5 all the way down the c column. It never changes, so it is written once. (Repeats are ignored, but they waste time.)
  • 1 in the Output column. The print comes after the doubling, so the first output is 2.
  • Line 5 for the arithmetic. < is a relational operator, not an arithmetic one.

Run it

The program, with a second print so that you can see b as well. The robot drives a centimetres on each pass, so each move is twice the one before.

It prints 2, 4, 8 and 16, and the robot's moves double each time. Change c to 7 and predict the last output before you run it.
The program
from bugbot import *
connect()

# Python program
a = 1
b = 1
c = 5
while b < c:
    a = a + a
    b = b + 1
    print(a)
    forward(60, distance=min(a, 20))
print("finished with a =", a, "and b =", b)
Put this demo on your own site

Paste it into a school website, Moodle, Google Sites or a blog. More options on the embed page.

Questions

What is the answer to AQA GCSE Computer Science 2025 Paper 1 Question 1.4?

a goes 1, 2, 4, 8, 16. b goes 1, 2, 3, 4, 5. c stays at 5. The outputs are 2, 4, 8 and 16.

What is the difference between a relational operator and an arithmetic operator?

An arithmetic operator calculates a number: +, -, *, /. A relational operator compares two values and gives True or False: <, >, <=, >=, == and !=.

Is + always addition in Python?

No. Between two numbers it adds. Between two strings it concatenates, joining them end to end. Which one happens depends on the data types.

More from this paper

Every AQA 8525 question we have worked · Guide: Trace tables explained

Learn it step by step

  1. F13.2 Trace tables Exam preparation
  2. F2.6 Condition-controlled loops: while Decisions and loops
  3. F1.9 Arithmetic operators Programming basics
Open the lessons

This is our own explanation of a published exam question. It is not written or endorsed by AQA, and the question paper and mark scheme remain AQA's copyright. Read them on AQA's site with the links on this page.