AQA 8525 3.2.10: Structured programming and subroutines (procedures and functions)
The free BugBot lessons that teach this point, a robot to try it on, and the past-paper questions that test it.
What it covers
The name says what to do. The brackets say do it now. Whatever is inside the brackets is extra information for the job:
- A name, then brackets
- Arguments you can hear
- No brackets, nothing happens
- Some functions need nothing, some need several things
- Some arguments have names
- Telling versus asking
- The robot's functions so far
Or do it in the simulator, with tasks that mark themselves
Lessons that teach it
- F1.3 Calling functions Programming basics
Arguments, telling and asking, and notes on the robot's buzzer. - F4.1 Writing functions Functions and structured code
def, calling, and why subprograms help. - F4.2 Parameters and return values Functions and structured code
Information in and an answer out; procedures and functions. - F4.3 Local and global variables Functions and structured code
Scope: where a variable exists, and why passing values beats global. - F4.5 Libraries and your own modules Functions and structured code
import, Python's own libraries, and a module file of your own.
Try it on a robot
The task from F1.3 Calling functions, running here. Change the program and press Run.
Past paper questions on this
Real exam questions that test this, each worked through with a program you can run.
- AQA 8525 June 2025 Paper 1, Question 7: Read a subroutine: purpose, outputs, return value, parameter 7 marks
- AQA 8525 June 2025 Paper 1, Question 11: Trace findLetter, then write the word game that calls it 14 marks
- AQA 8525 June 2024 Paper 1, Question 10: Trace three subroutines that call each other 2 marks
- AQA 8525 June 2024 Paper 1, Question 12.1 to 12.5: A sliding puzzle: move tiles, and read nested loops that find the blank 7 marks
- AQA 8525 June 2024 Paper 1, Question 12.6, 12.7: Use given subroutines to check a row and to play until solved 10 marks
- AQA 8525 June 2024 Paper 1, Question 14: Local variables, and a subroutine that counts busy days and returns the count 7 marks
- AQA 8525 June 2023 Paper 1, Question 4: Trace a Python function with three sets of inputs, then make it robust 4 marks
- AQA 8525 June 2023 Paper 1, Question 12.4: Fix a subroutine's parameter and a FOR loop that counts down 3 marks
- AQA 8525 June 2023 Paper 1, Question 14: Fill the gaps in an algorithm that uses a two-dimensional array 3 marks
- AQA 8525 June 2022 Paper 1, Question 11: Complete a subroutine that works out a sound file's size, local variables, why subroutines 10 marks
- AQA 8525 June 2022 Paper 1, Question 14.2: Write a subroutine that counts the asterisks on a bingo ticket 8 marks
- AQA 8525 Sample Paper 1, Question 9: Draw a robot's path through a grid from Forward, TurnLeft and ObjectAhead 6 marks
The specification is AQA's own document; this page says which of our lessons teach point 3.2.10 and is not endorsed by the board.