AQA GCSE Computer Science June 2025 Paper 1, Question 5: from five inputs to one loop

AQA 8525 June 2025 Paper 1, Question 5: describe a data type, explain why numbers are not stored as strings, name Python's type for real numbers, and rewrite a program with five input statements as a loop with one. Worked through, with both versions to run.

Past paper questionAQA 8525/1BJune 2025 Paper 18 marksWrite a program

Question 5 of the AQA GCSE Computer Science Paper 1 sat on 12 May 2025 (8525/1B, the Python paper) starts with three one mark parts on data types. Then it asks you to rewrite a program so that a loop does the work of five repeated lines (5 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

The program on the paper reads five whole numbers into num1 to num5, each with int(input()), adds them into total, and prints it.

Parts 1 to 3: data types

5.1 What is a data type? It says what kind of value a variable stores. (Or: it decides what operations can be done on the value.)

5.2 Why are the variables not strings? Because the values have to be added. With strings, + would concatenate: "2" + "3" is "23".

5.3 The Python data type for numbers with a fractional part. float. "Real" is the general name, and it is rejected here, because the question asks for the data type in Python.

Part 4: rewrite it with one input() (5 marks)

total = 0
for count in range(5):
    number = int(input())
    total = total + number
print(total)

The five marks: using a loop (design); a loop that runs exactly five times; one input in the right place; a correct running total; the total output after the loop.

A while loop with a counter gets the same marks.

Where the marks are lost

  • No total = 0. total = total + number fails on the first pass if total does not exist.
  • print(total) inside the loop. That prints five running totals. The original prints one number, and "achieves the same result" means the same output.
  • range(1, 5). Four passes. range(5) or range(1, 6) is five.
  • Keeping num1 to num5. One variable is enough. Each number is added to the total and then not needed again.
  • total = number. That replaces the total. It has to build up.

Run it

Both versions, one after the other, so that you can check they give the same result. HOW_MANY shows the real advantage of the loop: change one number and it adds up ten values, or a hundred.

Enter 1, 2, 3, 4 and 5: the total is 15. Change HOW_MANY to 3 and only three numbers are asked for. The five-variable version cannot do that.
The program
from bugbot import *
connect()

# the loop makes this easy to change
HOW_MANY = 5

total = 0
for count in range(HOW_MANY):
    number = int(input("Number " + str(count + 1) + ": "))
    total = total + number
print(total)
forward(60, distance=min(total, 60))
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 5.4?

Set total to 0. Loop five times: input a number as an integer and add it to total. After the loop, print total.

What is a data type?

A classification that says what kind of value a variable holds, such as integer, real, Boolean, character or string, and so which operations can be carried out on it.

What is the difference between real and float?

Real is the general name for a number with a fractional part, used in pseudo-code and in the specification. float is the name of that data type in Python.

More from this paper

Every AQA 8525 question we have worked

Learn it step by step

  1. F1.8 Data types and casting Programming basics
  2. F2.5 Count-controlled loops: for Decisions and loops
  3. F2.7 Loop patterns Decisions and loops
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.