OCR J277 2.2.3: Additional programming techniques
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. - F3.1 String handling Strings, lists and records
Length, indexing, slicing, searching and joining strings, and f-strings. - F3.3 Lists: one-dimensional arrays Strings, lists and records
Making, indexing and changing a list; append, remove, in, split and join. - F3.4 Iterating over a list Strings, lists and records
Loops over items and indexes, totals, counts, min and max, and linear search. - F3.5 Two-dimensional arrays Strings, lists and records
Rows and columns: the depth grid as a list of lists. - F3.6 Records Strings, lists and records
Grouping related fields: a sensor reading as a record, and a list of records as a table. - F3.7 Random numbers Strings, lists and records
randint, choice and seeds: dice, random tunes and a robot that wanders. - 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. - F7.1 Reading and writing files Files and databases
Open, read, write, append and close: a run log in a CSV file. - F7.2 Relational databases Files and databases
Tables, records, fields, primary and foreign keys, and avoiding redundancy. - F7.3 SQL: SELECT Files and databases
SELECT, FROM, WHERE and ORDER BY on the class's robot runs. - F7.4 SQL: two tables and changing data Files and databases
Queries across two tables; INSERT, UPDATE and DELETE, and the robot logging its own runs.
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 8: Trace a loop that compares two binary strings with OR, NOT and AND 6 marks
- AQA 8525 June 2025 Paper 1, Question 9: Which of five algorithms correctly total an array 2 marks
- AQA 8525 June 2025 Paper 1, Question 10: Records, and the smallest value in an array without min or sort 8 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 1: LEN, POSITION, a data type, assignment, and a two line program 6 marks
- AQA 8525 June 2024 Paper 1, Question 3: random.randrange, a test plan, and a syntax and a logic error 6 marks
- AQA 8525 June 2024 Paper 1, Question 7: Build a stock code with string indexing and concatenation 4 marks
- AQA 8525 June 2024 Paper 1, Question 8: Trace a loop over three arrays that uses DIV 6 marks
- AQA 8525 June 2024 Paper 1, Question 9: A data structure, a RECORD definition, and the dearer of two books 7 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
The specification is OCR's own document; this page says which of our lessons teach point 2.2.3 and is not endorsed by the board.