CS Tutor
Reference · OCR J277 & H446, Cambridge 9618, AQA 8525

Pseudocode across exam boards: OCR, Cambridge 9618, AQA and Python side by side

Pseudocode is not one notation. OCR's Exam Reference Language reads like Python, with = to assign and arrays from 0. Cambridge 9618 uses capital keywords, ←, typed DECLARE and arrays that usually start at 1. AQA mixes capitals and ← with 0-based indexing. Only Cambridge 9618 makes you write its own notation in the exam.

Below, all 51 constructs from the boards' own guides sit next to each other and next to Python, with the slips the examiners' reports say cost marks.

  1. OCR

    for i=1 to 5
        print(i)
    next i
  2. Cambridge 9618

    FOR i ← 1 TO 5
       OUTPUT i
    NEXT i
  3. AQA

    FOR i ← 1 TO 5
       OUTPUT i
    ENDFOR
  4. Python

    for i in range(1, 6):
        print(i)
    # ends at the dedent
OCR: for i=1 to 5, print(i), next i. Cambridge: FOR i ← 1 TO 5, OUTPUT i, NEXT i. AQA: FOR i ← 1 TO 5, OUTPUT i, ENDFOR. Python: for i in range(1, 6), print(i).

Junaid Khalid, software engineer and Computer Science tutor · Reviewed October 2026

01

The short answer

  • OCR Exam Reference Language reads like Python: lower-case keywords, = to assign, == to compare, arrays and strings from 0.
  • Cambridge 9618 pseudocode is the strictest and the most different: upper-case keywords, ← to assign, typed DECLARE, & to join strings, stated array bounds that usually start at 1, and CALL before a procedure.
  • AQA pseudo-code shares Cambridge's capitals and arrow but indexes from 0, writes ≠, closes loops with ENDFOR and uses one SUBROUTINE keyword for procedures and functions.
  • Only Cambridge 9618 makes you write its notation. OCR accepts a high-level language such as Python, and AQA accepts any clear format where pseudo-code is accepted.

The rest of this page is the detail behind those four lines. Every board cell is transcribed from the board's own document, with the section it came from, and where a guide does not define something the cell says so instead of guessing.

9

board documents read, with versions

7

examiner reports mined for slips

51

Python snippets executed by a test

25

worked results from the guides recomputed

How this was checked, on 8 October 2026: every guide was converted to text and each construct compared line by line with its PDF. The Cambridge guides for 2026 and for 2027 to 2029 were diffed against each other. Every Python cell runs in an automated test, and each result the guides quote, such as MID("ABCDEFGH", 2, 3) returning "BCD", is recomputed with that board's own indexing rule.

02

Do you have to write your board's pseudocode?

Only for Cambridge 9618. OCR accepts its Exam Reference Language or a high-level language such as Python, AQA accepts any clear format, and Cambridge 9618 Paper 2 requires its own pseudocode. The exact wording matters, and it changes between GCSE and A Level on the same board.

OCR GCSE J277, Component 02 Section B
“Answers written in pseudocode, natural English or bullet points will not be awarded marks.”

Cambridge OCR GCSE (9-1) Computer Science J277 specification, Version 3.1, May 2026. Section 3c, OCR Exam Reference Language

OCR A Level H446 and AS H046
“Learners are not expected to memorise the syntax of this pseudocode and when asked may provide answers in any style of pseudocode they choose providing its meaning could be reasonably inferred by a competent programmer.”

Cambridge OCR A Level Computer Science H446 specification, Version 3.0, April 2026. Appendix 5d, Pseudocode

Cambridge International 9618, Paper 2
“If the question asks for pseudocode, then variations with their studied programming language will be unacceptable for this component.”

Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23

AQA GCSE 8525
“Where pseudo-code is an accepted method of response, students may present their answers to questions in any suitable format and do not need to use the AQA pseudo-code.”

AQA GCSE Computer Science 8525 specification, Version 1.3, 16 June 2025. GCSE exams June 2027 onwards

Read the OCR GCSE line carefully: it does not ban code, it bans vagueness. Section B wants an answer in Exam Reference Language or a high-level programming language, judged for precision, so Python is fine and loose English is not. The Cambridge syllabus says Paper 2 candidates “will need to write answers in pseudocode”, and the examiners add that candidates “should not use language-specific functions or methods that do not appear in the Insert.” AQA's own guide puts its only direction in one line: pseudo-code must be “clear, consistent and unambiguous.”

AQA A-level is the odd case. AQA publishes a pseudo-code guide for GCSE only. The 7517 specification asks you to express algorithms in pseudo-code and hand-trace them, but defines no syntax. The June 2022 Paper 1 printed pseudo-code close to the GCSE style with its own differences: FUNCTION G(V, P) ... ENDFUNCTION rather than SUBROUTINE, FOR EACH N IN ConnectedNodes[V], LENGTH(Visited) rather than LEN(), and even a line of plain English, “Set all elements of Visited to False”, inside a function. If you take AQA A-level, learn to read both and write whatever is clearest.

03

How do OCR, Cambridge and AQA pseudocode differ?

Fourteen differences, and if you only learn one table, learn this one. Each row is a place where moving between boards, or between a board and Python, changes the answer.

The same construct written in OCR Exam Reference Language, Cambridge 9618 pseudocode, AQA pseudo-code and Python
ConstructOCRCambridge 9618AQAPython
Assignx = 3x ← 3x ← 3x = 3
Test equality======
Not equal!=<>≠!=
Join strings+&++
First index0Declared, usually 10 unless stated0
2D elementboard[1,0]Grid[2,3]table[3][1]table[3][1]
String lengths.lengthLENGTH(s)LEN(s)len(s)
Substrings.substring(start, count)MID(s, start, length)SUBSTRING(start, end, s)s[start:stop]
Close FORnext iNEXT iENDFORdedent
Else-ifelseifNot definedELSE IFelif
Multi-way branchswitch ... endswitchCASE OF ... ENDCASENot definedmatch (3.10+)
Call a proceduregreeting("Ann")CALL Greeting("Ann")greeting('Ann')greeting("Ann")
Comment////##
Keywordslower caseUPPER CASEUPPER CASElower case

The substring row is the expensive one. The same five letters come out of three different calls: subject.substring(3,5) in OCR is start 3, five characters, counting from 0. MID(s, 2, 3) in Cambridge is start 2, three characters, counting from 1. SUBSTRING(2, 9, s) in AQA is from position 2 to position 9 inclusive, counting from 0. Python's s[2:10] stops before 10. Each of those examples is the board's own, and our test suite recomputes every quoted result.

04

All 51 constructs, side by side

Every construct that at least one board's guide defines, in four columns: OCR, Cambridge 9618, AQA and Python. Pick the boards you want to compare, or filter by a word such as loop, substring or ENDCASE. The view is saved in the address bar, so you can send a class straight to “OCR against Cambridge, files only”. Every snippet has a copy button, and every Python snippet is run by our test suite before the page is published.

Show

51 of 51 shown

Compare

Basics8 constructs

Comments

#comment

OCR and Cambridge use //. AQA and Python use #. comment remark

OCR
//This function squares a number

J277 3c

Cambridge 9618
// this procedure swaps
// values of X and Y

Each line of a multi-line comment starts with //. 9618 guide 1.5

AQA
# comment
# comment and so on

Multi-line comments repeat # on every line. AQA p. 2

Python
# This function squares a number

Assignment

#assignment

OCR assigns with =. Cambridge and AQA use the arrow, because = is their equality test. assign arrow equals variable

OCR
x = 3
name = "Louise"

J277 3c

Cambridge 9618
Counter ← 0
Counter ← Counter + 1

The assignment operator is ←. 9618 guide 2.6

AQA
a ← 3
b ← a + 1
c ← 'Hello'

AQA p. 2

Python
x = 3
name = "Louise"

Constants

#constant

Cambridge writes CONSTANT X = value. AQA writes CONSTANT X ← value. Same keyword, different operator. const constant

OCR
const vat = 0.2

Defined in J277 only. The H446 appendix has no constant keyword. J277 3c

Cambridge 9618
CONSTANT HourlyRate = 6.50
CONSTANT DefaultText = "N/A"

Only literals can be used as the value of a constant. 9618 guide 2.5

AQA
CONSTANT PI ← 3.141
CONSTANT CLASS_SIZE ← 23

Names of constants are always written in capitals. AQA p. 2

Python
VAT = 0.2

Capitals are a naming convention only. Python has no constant keyword.

Declaring a variable and its type

#declare

Only Cambridge has a declaration statement. OCR declares on first assignment. declare declaration type integer real string boolean char date

OCR

Not defined in the guide. No declaration statement. H446: a variable is declared the first time a value is assigned and assumes the data type of that value.

Cambridge 9618
DECLARE Counter : INTEGER
DECLARE TotalToPay : REAL
DECLARE GameOver : BOOLEAN

Types: INTEGER, REAL, CHAR, STRING, BOOLEAN, DATE. Declaring is described as good practice. 9618 guide 2.1, 2.4

AQA

Not defined in the guide. Type names (String, Real, Integer) appear only inside RECORD declarations.

Python
counter: int = 0
total_to_pay: float = 0.0

Annotations are optional hints. counter = 0 is the usual form.

Global variables

#global

Only OCR has a keyword for it. global scope local

OCR
global userID = "Cust001"

Variables declared inside a function or procedure are local to it (H446). J277 3c

Cambridge 9618

Not defined in the guide.

AQA

Not defined in the guide.

Python
user_id = "Cust001"

def log_out():
    global user_id
    user_id = ""

global is only needed to reassign the name inside a function.

Input

#input

OCR's input() takes a prompt. Cambridge INPUT is a statement. AQA USERINPUT is an expression. input read keyboard userinput

OCR
myName = input("Please enter a name")

J277 3c

Cambridge 9618
INPUT Answer

9618 guide 5.1

AQA
a ← USERINPUT

AQA p. 15

Python
my_name = input("Please enter a name")

Output

#output

OCR uses print(). Cambridge and AQA use OUTPUT with comma-separated values. output print display

OCR
print("My name is Noni")

J277 3c

Cambridge 9618
OUTPUT "You have ", Lives, " lives left"

9618 guide 5.1

AQA
OUTPUT a
OUTPUT a, g

AQA p. 15

Python
print("You have", lives, "lives left")

Keyword case

#case-convention

OCR keywords are lower case. Cambridge and AQA keywords are upper case. case uppercase lowercase capital keyword indentation

OCR
if ... then
elseif ... then
else
endif

Lower-case keywords; operators AND, OR, NOT, MOD and DIV are capitals. J277 3c

Cambridge 9618
IF ... THEN
ELSE
ENDIF

Keywords upper case, identifiers mixed case (NumberOfPlayers), indent usually three spaces. Identifiers are case insensitive. 9618 guide 1.2, 1.3, 2.3

AQA
IF ... THEN
ELSE IF ... THEN
ELSE
ENDIF

Keywords are emboldened in the guide and printed in capitals. AQA p. 1, 8

Python
if score > 10:
    print("high")
elif score > 5:
    print("medium")
else:
    print("low")

Lower case, case sensitive, and indentation is syntax.

Operators7 constructs

Arithmetic

#arithmetic

All four use + - * /. Cambridge says / always gives a REAL. add subtract multiply divide plus minus times

OCR
x = 6+5     // gives 11
x = 12/2    // gives 6

H446 5d

Cambridge 9618
TotalToPay ← NumberOfHours * HourlyRate

/ gives a REAL even if both operands are integers. 9618 guide 5.2

AQA
a + b * c
(a + b) * c

Brackets indicate precedence. / is used instead of ÷. AQA p. 3

Python
x = 6 + 5   # 11
x = 12 / 2  # 6.0 (always a float)

Integer division and remainder

#div-mod

Every board spells them DIV and MOD. Python uses // and %. div mod modulus quotient remainder integer division floor

OCR
17 DIV 5   // gives 3
12 MOD 5   // gives 2

H446 5d

Cambridge 9618
10 DIV 3   // evaluates to 3
10 MOD 3   // evaluates to 1

The examples are from the Paper 2 insert; the guide defines DIV and MOD without examples. 9618 guide 5.2; 9618/21 insert

AQA
9 DIV 5   # evaluates to 1
9 MOD 5   # evaluates to 4

AQA p. 3

Python
17 // 5   # 3
12 % 5    # 2

// floors, so -7 // 2 is -4. No guide defines DIV or MOD for negative numbers.

Exponent

#power

Only OCR defines one, and it is ^, which means something else in Python. power exponent squared index

OCR
3^4   // gives 81

H446 5d

Cambridge 9618

Not defined in the guide.

AQA

Not defined in the guide.

Python
3 ** 4   # 81

In Python ^ is bitwise XOR, so 3 ^ 4 is 7.

Comparison

#comparison

Equality is == in OCR, = in Cambridge and AQA. Not-equal is != , <> and ≠ respectively. equal not equal less greater compare relational

OCR
==  !=  <  <=  >  >=

J277 3c

Cambridge 9618
=  <>  <  <=  >  >=

9618 guide 5.3

AQA
=  ≠  <  ≤  >  ≥

AQA p. 4

Python
a == b, a != b
a < b, a <= b
a > b, a >= b

Boolean operators

#logical

AND, OR, NOT in capitals on every board. Lower case in Python. and or not boolean logic

OCR
while x<=5 AND flag==false

H446 5d

Cambridge 9618
AND  OR  NOT

9618 guide 5.4

AQA
(3 = 3) AND (3 ≤ 4)
(x < 1) OR (x > 9)
NOT (a < b)

AQA p. 4

Python
x <= 5 and not flag

Joining strings

#concat

Cambridge is the odd one out: & joins strings, and + costs marks. concatenate concatenation join ampersand plus

OCR
print("Hello, your name is: " + name)

J277 3c

Cambridge 9618
"Summer" & " " & "Pudding"

Produces "Summer Pudding". 9618 guide 5.5

AQA
'computer' + 'science'

Evaluates to 'computerscience'. AQA p. 13

Python
greeting = "Hello, your name is: " + name
greeting = f"Hello, your name is: {name}"

String, character and Boolean literals

#literals

Cambridge separates 'X' (CHAR) from "X" (STRING). AQA's examples use single quotes. quotes string char character boolean true false literal

OCR
name = "Bob"
flag == false

Double quotes for strings; the H446 example writes false in lower case. H446 5d

Cambridge 9618
'x'           // CHAR
"This is a string"   // STRING
TRUE  FALSE

A REAL literal always has a digit either side of the point: 4.0, 0.3. 9618 guide 2.2

AQA
c ← 'Hello'
True  False

Boolean values are written False or True. AQA p. 1, 2

Python
'x' == "x"   # True: both are str
game_over = False

Selection3 constructs

IF ... ELSE

#if-else

OCR needs then and endif in lower case. Cambridge and AQA use THEN ... ENDIF. if then else endif selection condition

OCR
if answer == "Yes" then
    print("Correct")
else
    print("Error")
endif

J277 3c

Cambridge 9618
IF ChallengerScore > ChampionScore THEN
   OUTPUT ChallengerName, " is the new champion"
ELSE
   OUTPUT ChampionName, " is still the champion"
ENDIF

9618 guide 6.1

AQA
IF (a MOD 2) = 0 THEN
   OUTPUT 'even'
ELSE
   OUTPUT 'odd'
ENDIF

AQA p. 7

Python
if answer == "Yes":
    print("Correct")
else:
    print("Error")

Else-if chains

#else-if

OCR: elseif (one word). AQA: ELSE IF (two words). Cambridge defines neither. elseif else if elif chain nested

OCR
if answer == "Yes" then
    print("Correct")
elseif answer == "No" then
    print("Wrong")
else
    print("Error")
endif

J277 3c

Cambridge 9618

Not defined in the guide. Its own example nests an IF inside the ELSE, each with its own ENDIF. CASE is the other route.

AQA
IF (a MOD 4) = 0 THEN
   OUTPUT 'multiple of 4'
ELSE IF (a MOD 4) = 1 THEN
   OUTPUT 'leaves a remainder of 1'
ELSE
   OUTPUT 'leaves a remainder of 3'
ENDIF

AQA p. 8

Python
if answer == "Yes":
    print("Correct")
elif answer == "No":
    print("Wrong")
else:
    print("Error")

CASE / switch

#case

OCR: switch ... endswitch. Cambridge: CASE OF ... ENDCASE with ranges. AQA has none. case switch select otherwise default match

OCR
switch day :
    case "Sat":
        print("Saturday")
    case "Sun":
        print("Sunday")
    default:
        print("Weekday")
endswitch

J277 3c

Cambridge 9618
CASE OF Move
   'W' : Position ← Position - 10
   'S' : Position ← Position + 10
   OTHERWISE : CALL Beep
ENDCASE

A case can be a range: <value1> TO <value2>. Cases are tested in order and only the first match runs. OTHERWISE must be last. 9618 guide 6.2

AQA

Not defined in the guide. Use IF ... ELSE IF.

Python
match day:
    case "Sat":
        print("Saturday")
    case "Sun":
        print("Sunday")
    case _:
        print("Weekday")

match needs Python 3.10 or later.

Iteration5 constructs

Count-controlled loop

#for

OCR and Cambridge close with next i / NEXT i. AQA closes with ENDFOR. All include the end value; Python's range does not. for loop next endfor count controlled definite range

OCR
for i=0 to 9
    print("Loop")
next i

Prints "Loop" 10 times, 0 to 9 inclusive. J277 3c

Cambridge 9618
FOR Index ← 1 TO 30
   StudentNames[Index] ← ""
NEXT Index

Both bounds inclusive. Repeating the identifier after NEXT is good practice. 9618 guide 3.2, 7.1

AQA
FOR a ← 1 TO 3
   OUTPUT a
ENDFOR
# will output 1, 2, 3

The loop variable does not exist after the loop has finished. AQA p. 6

Python
for i in range(0, 10):
    print("Loop")

range(0, 10) stops at 9: the end value is excluded.

Loop with a step

#for-step

step in OCR, STEP in Cambridge and AQA. All three allow a negative step. step decrement count down negative

OCR
for i=10 to 0 step -1
    print(i)
next i

Prints 10 down to 0 inclusive. J277 3c

Cambridge 9618
FOR Position ← 20 TO 10 STEP -1
   ...
NEXT Position

9618 guide 7.1, 9.2

AQA
FOR a ← 5 TO 1 STEP -2
   OUTPUT a
ENDFOR
# will output 5, 3, 1

AQA p. 6

Python
for i in range(10, -1, -1):
    print(i)

Pre-condition loop (WHILE)

#while

while ... endwhile on OCR, WHILE ... ENDWHILE on Cambridge and AQA. No DO on any board. while endwhile condition controlled pre-condition indefinite

OCR
while answer != "Correct"
    answer = input("New answer")
endwhile

J277 3c

Cambridge 9618
WHILE Number > 9
   Number ← Number - 9
ENDWHILE

9618 guide 7.3

AQA
WHILE a < 4
   OUTPUT a
   a ← a + 1
ENDWHILE

AQA p. 5

Python
while answer != "Correct":
    answer = input("New answer")

Post-condition loop

#repeat

OCR: do ... until. Cambridge and AQA: REPEAT ... UNTIL. Python has no equivalent keyword. repeat until do post-condition

OCR
do
    answer = input("New answer")
until answer == "Correct"

Runs once before the condition is checked. J277 3c

Cambridge 9618
REPEAT
   OUTPUT "Please enter the password"
   INPUT Password
UNTIL Password = "Secret"

9618 guide 7.2

AQA
REPEAT
   OUTPUT a
   a ← a + 1
UNTIL a = 4

AQA p. 5

Python
while True:
    answer = input("New answer")
    if answer == "Correct":
        break

For each item

#for-each

Only AQA defines it. Cambridge examiners have penalised it as Python-like syntax. for each in foreach iterate collection

OCR

Not defined in the guide.

Cambridge 9618

Not defined in the guide. The June 2024 examiner report lists FOR Line IN InputFile as a common mistake.

AQA
FOR prime IN primes
   total ← total + prime
ENDFOR

Also works over the characters of a string. Array items cannot be modified this way. AQA p. 6, 10

Python
for prime in primes:
    total = total + prime

Arrays and records7 constructs

Declaring a 1D array

#array-1d

OCR and AQA index from 0. Cambridge states both bounds, usually from 1. array list declare one-dimensional index bound zero

OCR
array colours[5]
array colours = ["Blue", "Pink", "Green", "Yellow", "Red"]

array colours[5] has 5 elements, index 0 to 4. Arrays store a single data type. J277 3c

Cambridge 9618
DECLARE StudentNames : ARRAY[1:30] OF STRING

Good practice to state the lower bound; generally 1 is used. 9618 guide 3.1

AQA
primes ← [2, 3, 5, 7, 11, 13]

Exam questions index from 0 unless they say otherwise. AQA p. 1, 9

Python
colours = ["Blue", "Pink", "Green", "Yellow", "Red"]
names = [""] * 5

Reading and updating an element

#array-access

Square brackets everywhere. Watch which index is first. index element subscript update

OCR
names[3] = "Noni"
print(names[3])

J277 3c; H446 5d

Cambridge 9618
StudentNames[1] ← "Ali"
StudentNames[n+1] ← StudentNames[n]

9618 guide 3.2

AQA
primes[0]       # evaluates to 2
primes[5] ← 17

AQA p. 9

Python
names[3] = "Noni"
print(names[3])

2D arrays

#array-2d

OCR and Cambridge write [row, column]. AQA and Python write [row][column]. 2d two-dimensional matrix grid table

OCR
array gameboard[8,8]
gameboard[1,0] = "Pawn"

J277 3c

Cambridge 9618
DECLARE NoughtsAndCrosses : ARRAY[1:3,1:3] OF CHAR
NoughtsAndCrosses[2,3] ← 'X'

9618 guide 3.1, 3.2

AQA
table ← [[1, 2],[2, 4],[3, 6],[4, 8]]
table[3][1]        # evaluates to 8
table[3][1] ← 16

AQA p. 9

Python
gameboard = [["" for col in range(8)] for row in range(8)]
gameboard[1][0] = "Pawn"

Assigning a whole array

#array-whole

Cambridge allows it for same-size arrays, and bans assigning a range in one statement. copy array assign whole

OCR

Not defined in the guide.

Cambridge 9618
SavedGame ← NoughtsAndCrosses

Allowed if same size and type. StudentNames[1 TO 30] ← "" should not be used: loop instead. 9618 guide 3.2

AQA

Not defined in the guide.

Python
saved_game = [row[:] for row in board]

saved_game = board would share the same list, not copy it.

Length of an array

#array-length

Only AQA defines it, as LEN(). len length size count array

OCR

Not defined for arrays in the guide (.length is defined for strings).

Cambridge 9618

Not defined for arrays in the guide (LENGTH is a string function).

AQA
LEN(primes)      # evaluates to 6
LEN(table[0])    # evaluates to 2

AQA p. 10

Python
len(primes)
len(table[0])

Records

#record

Cambridge: TYPE ... ENDTYPE with DECLARE lines. AQA: RECORD ... ENDRECORD. OCR's guide has none. record type struct field dot notation user-defined

OCR

Not defined in the guide, although J277 content (2.2.3) covers the use of records to store data.

Cambridge 9618
TYPE StudentRecord
   DECLARE LastName : STRING
   DECLARE YearGroup : INTEGER
ENDTYPE

DECLARE Pupil1 : StudentRecord
Pupil1.LastName ← "Johnson"
Form[Index].YearGroup ← Form[Index].YearGroup + 1

9618 guide 4.1, 4.2

AQA
RECORD Car
   make : String
   model : String
   reg : String
   price : Real
   noOfDoors : Integer
ENDRECORD

myCar ← Car('Ford', 'Focus', 'DX17 GYT', 1399.99, 5)
myCar.model ← 'Fiesta'

AQA p. 11

Python
from dataclasses import dataclass

@dataclass
class Car:
    make: str
    model: str
    reg: str
    price: float
    no_of_doors: int

my_car = Car("Ford", "Focus", "DX17 GYT", 1399.99, 5)
my_car.model = "Fiesta"

Enumerated, pointer and set types

#user-types

Cambridge only. enum enumerated pointer set caret type

OCR

Not defined in the guide.

Cambridge 9618
TYPE Season = (Spring, Summer, Autumn, Winter)
TYPE TIntPointer = ^INTEGER
TYPE LetterSet = SET OF CHAR
DEFINE Vowels ('A','E','I','O','U'): LetterSet

MyPointer ← ^ThisSeason takes an address; MyPointer^ reads the value stored there. 9618 guide 4.1, 4.2

AQA

Not defined in the guide.

Python
from enum import Enum

class Season(Enum):
    SPRING = 1
    SUMMER = 2
    AUTUMN = 3
    WINTER = 4

vowels = {"A", "E", "I", "O", "U"}

Python has no pointer type.

Procedures and functions5 constructs

Defining a procedure

#procedure

AQA has one keyword, SUBROUTINE, for both kinds. A RETURN makes it a function. procedure subroutine define endprocedure

OCR
procedure greeting(name)
    print("hello"+name)
endprocedure

H446 5d

Cambridge 9618
PROCEDURE Square(Size : INTEGER)
   FOR Side ← 1 TO 4
      CALL MoveForward(Size)
      CALL Turn(90)
   NEXT Side
ENDPROCEDURE

Every parameter has a data type. 9618 guide 8.1

AQA
SUBROUTINE showAdd(a, b)
   result ← a + b
   OUTPUT result
ENDSUBROUTINE

A subroutine with no RETURN is a procedure. AQA p. 12

Python
def greeting(name):
    print("hello" + name)

Calling a procedure

#procedure-call

Cambridge alone needs CALL, and only for procedures. call invoke procedure

OCR
greeting("Hamish")

H446 5d

Cambridge 9618
CALL Square(100)
CALL DefaultSquare()

9618 guide 8.1

AQA
showAdd(2, 3)

AQA p. 12

Python
greeting("Hamish")

Defining a function

#function

Cambridge declares the return type with RETURNS. OCR and AQA do not type anything. function return returns endfunction

OCR
function triple(number)
    return number*3
endfunction

H446 5d

Cambridge 9618
FUNCTION Max(Number1 : INTEGER, Number2 : INTEGER) RETURNS INTEGER
   IF Number1 > Number2 THEN
      RETURN Number1
   ELSE
      RETURN Number2
   ENDIF
ENDFUNCTION

RETURN ends the function immediately. 9618 guide 8.2

AQA
SUBROUTINE add(a, b)
   result ← a + b
   RETURN result
ENDSUBROUTINE

AQA p. 12

Python
def triple(number):
    return number * 3

Calling a function

#function-call

A function call is part of an expression. Writing CALL in front of one is a Cambridge mark-loser. call function expression return value

OCR
y=triple(7)

H446 5d

Cambridge 9618
OUTPUT "Penalty Fine = ", Max(10, Distance*2)

The keyword CALL should not be used when calling a function. 9618 guide 8.2

AQA
answer ← add(2, 3) * 6

AQA p. 12

Python
y = triple(7)

By value and by reference

#byref

By value is the default on OCR and Cambridge. Cambridge's BYREF covers every parameter after it. byref byval reference value parameter passing

OCR
procedure foobar(x:byVal, y:byRef)
    ...
endprocedure

A-Level only. Values are passed by value unless stated. H446 5d

Cambridge 9618
PROCEDURE SWAP(BYREF X : INTEGER, Y : INTEGER)
   Temp ← X
   X ← Y
   Y ← Temp
ENDPROCEDURE

BYREF need not be repeated, so Y is by reference too. Parameters should not be passed by reference to a function. 9618 guide 8.3

AQA

Not defined in the guide.

Python
def swap(x, y):
    return y, x

a, b = swap(a, b)

Python has no by-reference parameters. Return the new values, or mutate a list passed in.

Strings and conversion7 constructs

String length

#length

.length in OCR, LENGTH() in Cambridge, LEN() in AQA. Cambridge examiners have penalised LEN(). length len size characters

OCR
subject = "ComputerScience"
subject.length        // gives 15

J277 3c

Cambridge 9618
LENGTH("Happy Days")   // returns 10

9618 guide 5.5

AQA
LEN('computer science')   # evaluates to 16

AQA p. 13

Python
len("Happy Days")   # 10

Substrings

#substring

Three boards, three argument orders: (start, count) from 0; (string, start, length) from 1; (start, end, string) inclusive from 0. substring mid slice substr part

OCR
subject.substring(3,5)   // returns "puter"

Start index, then number of characters. 0 indexed. J277 3c

Cambridge 9618
MID("ABCDEFGH", 2, 3)   // returns "BCD"

String, start position, length. Position 1 is the first character. 9618 guide 5.5

AQA
SUBSTRING(2, 9, 'computer science')
# evaluates to 'mputer s'

Start position, end position (both included), then the string. Indexing from 0. AQA p. 13

Python
"ComputerScience"[3:8]      # 'puter'    = OCR substring(3,5)
"ABCDEFGH"[1:4]             # 'BCD'      = MID(..., 2, 3)
"computer science"[2:10]    # 'mputer s' = SUBSTRING(2, 9, ...)

A slice [a:b] starts at a and stops before b.

Left and right characters

#left-right

OCR methods .left() and .right(). Cambridge's guide has RIGHT only; LEFT appears in the exam insert. left right first last characters

OCR
subject.left(4)    // returns "Comp"
subject.right(3)   // returns "nce"

J277 3c

Cambridge 9618
RIGHT("ABCDEFGH", 3)   // returns "FGH"
LEFT("ABCDEFGH", 3)    // returns "ABC"

RIGHT is in the guide. LEFT is not; it is supplied in the Paper 2 insert. 9618 guide 5.5; 9618/21 insert

AQA

Not defined in the guide. Use SUBSTRING.

Python
subject[:4]    # 'Comp'
subject[-3:]   # 'nce'

Upper and lower case

#case-convert

The Cambridge guide's UCASE/LCASE take one CHAR. The exam insert uses TO_UPPER/TO_LOWER instead. upper lower ucase lcase to_upper to_lower capital

OCR
subject.upper   // gives "COMPUTERSCIENCE"
subject.lower   // gives "computerscience"

J277 3c

Cambridge 9618
UCASE('h')   // returns 'H'
LCASE('W')   // returns 'w'

The June 2024 Paper 2 insert gives TO_UPPER(x) and TO_LOWER(x) for a CHAR or a STRING, e.g. TO_UPPER("Error 803"). 9618 guide 5.5; 9618/21 insert

AQA

Not defined in the guide.

Python
subject.upper()
subject.lower()

Character codes

#char-codes

OCR: ASC/CHR. AQA: CHAR_TO_CODE/CODE_TO_CHAR. Cambridge: only in the exam insert. ascii asc chr ord char code unicode

OCR
ASC('A')   // returns 65
CHR(97)    // returns 'a'

J277 3c

Cambridge 9618
ASC('A')   // returns 65
CHR(65)    // returns 'A'

Exam insert onlyNot in the guide. Supplied in the Paper 2 insert. 9618/21 insert

AQA
CHAR_TO_CODE('a')   # evaluates to 97
CODE_TO_CHAR(97)    # evaluates to 'a'

AQA p. 14

Python
ord("A")   # 65
chr(97)    # 'a'

Converting between types

#casting

OCR borrows Python's names. AQA spells out every direction. Cambridge's guide has INT(); the rest are in the insert. cast casting convert int str float real string to int

OCR
str(345)
int("3")
float("4.52")
real("4.52")
bool("True")

J277 3c

Cambridge 9618
INT(27.5415)   // returns 27

The Paper 2 insert adds NUM_TO_STR(87.5) returns "87.5", STR_TO_NUM("23.45") and IS_NUM(). 9618 guide 5.6; 9618/21 insert

AQA
STRING_TO_INT('16')
STRING_TO_REAL('16.3')
INT_TO_STRING(16)
REAL_TO_STRING(16.3)

AQA p. 14

Python
str(345)
int("3")
float("4.52")
int(27.5415)   # 27

Careful: bool("False") is True in Python, because any non-empty string is True.

Random numbers

#random

OCR random(1,6) and AQA RANDOM_INT(1, 6) include both ends. Cambridge RAND(x) gives a REAL below x. random rand dice randint

OCR
myVariable = random(1,6)
myVariable = random(-1.0,10.0)

An integer 1 to 6 inclusive; a real -1.0 to 10.0 inclusive. J277 3c

Cambridge 9618
RAND(87)   // may return 35.43

A REAL from 0 up to, but not including, x. 9618 guide 5.6

AQA
diceRoll ← RANDOM_INT(1, 6)

Between 1 and 6 inclusive. AQA p. 15

Python
import random
random.randint(1, 6)       # 1 to 6 inclusive
random.uniform(-1.0, 10.0)

File handling5 constructs

Opening and reading a text file

#file-read

OCR GCSE writes open(), OCR A-Level writes openRead(). Cambridge uses statements with the file name every time. file open read readline openfile readfile

OCR
myFile = open("sample.txt")
x = myFile.readLine()
myFile.close()

J277. The H446 appendix opens for reading with openRead("sample.txt"). J277 3c; H446 5d

Cambridge 9618
OPENFILE "FileA.txt" FOR READ
READFILE "FileA.txt", LineOfText
CLOSEFILE "FileA.txt"

Modes: READ, WRITE, APPEND. A file is open in one mode at a time. 9618 guide 9.1

AQA

Not defined in the guide.

Python
with open("sample.txt") as my_file:
    x = my_file.readline()

Reading to the end of a file

#file-eof

OCR: .endOfFile(). Cambridge: EOF(file name), which examiners report candidates leave empty. eof end of file endoffile loop lines

OCR
while NOT myFile.endOfFile()
    print(myFile.readLine())
endwhile

J277 3c

Cambridge 9618
WHILE NOT EOF("FileA.txt")
   READFILE "FileA.txt", LineOfText
ENDWHILE

9618 guide 9.1

AQA

Not defined in the guide.

Python
with open("sample.txt") as my_file:
    for line in my_file:
        print(line.rstrip("\n"))

Writing to a text file

#file-write

OCR's two guides disagree: J277 writeLine adds to the end, H446 openWrite overwrites. write writeline writefile append openwrite

OCR
myFile = openWrite("sample.txt")
myFile.writeLine("Hello World")
myFile.close()

H446: openWrite overwrites any previous contents. J277: writeLine on a file from open() writes to the END of the file. H446 5d; J277 3c

Cambridge 9618
OPENFILE "FileB.txt" FOR WRITE
WRITEFILE "FileB.txt", LineOfText
CLOSEFILE "FileB.txt"

WRITE creates a new file and loses existing data. APPEND adds after it. 9618 guide 9.1

AQA

Not defined in the guide.

Python
with open("sample.txt", "w") as my_file:
    my_file.write("Hello World\n")

"w" overwrites, "a" appends.

Creating a new file

#file-new

Only OCR GCSE has a separate command. newfile create file

OCR
newFile("myText.txt")

The file then has to be opened with open(). J277 3c

Cambridge 9618

Not defined in the guide. No separate command. Opening FOR WRITE creates a new file.

AQA

Not defined in the guide.

Python
open("myText.txt", "x").close()   # fails if it exists

Random-access files

#file-random

Cambridge only: SEEK, GETRECORD and PUTRECORD. random access seek getrecord putrecord binary

OCR

Not defined in the guide.

Cambridge 9618
OPENFILE "StudentFile.Dat" FOR RANDOM
SEEK "StudentFile.Dat", 10
GETRECORD "StudentFile.Dat", Pupil
PUTRECORD "StudentFile.Dat", NewPupil

9618 guide 9.2

AQA

Not defined in the guide.

Python
with open("students.dat", "r+b") as f:
    f.seek(10 * RECORD_SIZE)
    data = f.read(RECORD_SIZE)

Python seeks to a byte offset, so the record size is yours to define.

Objects4 constructs

Class and constructor

#class

Both OCR A-Level and Cambridge call the constructor new / NEW. AQA's guide has no objects. class object constructor new oop attribute

OCR
class Pet
    private name
    public procedure new(givenName)
        name=givenName
    endprocedure
endclass

A-Level (H446) only. H446 5d

Cambridge 9618
CLASS Pet
   PRIVATE Name : STRING
   PUBLIC PROCEDURE NEW(GivenName : STRING)
      Name ← GivenName
   ENDPROCEDURE
ENDCLASS

9618 guide 10.2

AQA

Not defined in the guide.

Python
class Pet:
    def __init__(self, given_name):
        self._name = given_name

Inheritance

#inherit

inherits / INHERITS, and the parent constructor is reached through super / SUPER. inherit inherits super subclass parent

OCR
class Dog inherits Pet
    private breed
    public procedure new(givenName, givenBreed)
        super.new(givenName)
        breed=givenBreed
    endprocedure
endclass

H446 5d

Cambridge 9618
CLASS Cat INHERITS Pet
   PRIVATE Breed: STRING
   PUBLIC PROCEDURE NEW(GivenName : STRING, GivenBreed : STRING)
      SUPER.NEW(GivenName)
      Breed ← GivenBreed
   ENDPROCEDURE
ENDCLASS

The 2026 guide declared Breed as INTEGER while assigning it a STRING. The 2027 to 2029 guide fixes it. 9618 guide 10.2

AQA

Not defined in the guide.

Python
class Dog(Pet):
    def __init__(self, given_name, given_breed):
        super().__init__(given_name)
        self._breed = given_breed

Creating an object and calling a method

#object-use

OCR: new Dog(...). Cambridge: NEW Cat(...). Python has no new keyword. instance instantiate new method call object

OCR
myDog = new Dog("Fido", "Scottish Terrier")
player.setAttempts(5)
print(player.getAttempts())

H446 5d

Cambridge 9618
MyCat ← NEW Cat("Kitty", "Shorthaired")
Player.SetAttempts(5)
OUTPUT Player.GetAttempts()

9618 guide 10.1, 10.2

AQA

Not defined in the guide.

Python
my_dog = Dog("Fido", "Scottish Terrier")
player.set_attempts(5)
print(player.get_attempts())

Public and private members

#access

Both boards assume public unless the question says otherwise. public private access modifier encapsulation getter setter

OCR
private attempts = 3
public procedure setAttempts(number)
    attempts=number
endprocedure
public function getAttempts()
    return attempts
endfunction

H446 5d

Cambridge 9618
PRIVATE Attempts : INTEGER
PUBLIC PROCEDURE SetAttempts(Number : INTEGER)
   Attempts ← Number
ENDPROCEDURE
PRIVATE FUNCTION GetAttempts() RETURNS INTEGER
   RETURN Attempts
ENDFUNCTION

9618 guide 10.1

AQA

Not defined in the guide.

Python
class Player:
    def __init__(self):
        self._attempts = 3

    def set_attempts(self, number):
        self._attempts = number

    def get_attempts(self):
        return self._attempts

A leading underscore marks a member as private by convention only.

05

What does each guide leave out?

Of the 51 constructs on this page, OCR's two documents define 44, the Cambridge guide defines 44 (plus 1 that only appears in the exam insert), and AQA's GCSE guide defines 33. 9 constructs exist on one board only, such as declaring a variable and its type (Cambridge), global variables (OCR), exponent (OCR) and for each item (AQA). A gap is not a ban: if a question needs something the guide leaves out, the paper will explain it, and in your own answers you can write anything clear.

OCR defines it Cambridge defines it AQA defines itExam insert onlyNot defined
06

Slips examiners penalise, board by board

Many of the slips the reports name are Python habits carried into pseudocode: + instead of Cambridge's &, LEN(), FOR ... IN, and half-written conditions such as Num1 > Num2 AND Num3. These come from the examiners' own reports, not from guesswork. Where the report prints the line, it is labelled quoted in the report. Where the report describes the mistake in words, the line is labelled our example and shows the mistake it describes.

Cambridge OCR Exam Reference Language7 slips

  • Half a condition

    Lost marksquoted in the report

    if PIN == "1234" OR "4321"

    Earns themquoted in the report

    if PIN == "1234" OR PIN == "4321"

    Printed in the report as incorrect, with the correction. Each side of OR must be a valid comparison, which usually means naming the variable twice.

    OCR J277/02 Examiners' report, Summer 2025.

  • A comma is not concatenation

    Lost marksour example

    message = word1, word2

    Earns themour example

    message = word1 + word2

    Using a comma to join strings was a common mistake: in most languages, and especially Python, a comma prints two items or passes two arguments. Printing the message instead of storing it was also not what was asked.

    OCR J277/02 Examiners' report, Summer 2024.

  • Renaming the variables you were given

    Lost marksquoted in the report

    word 1   wordone   world1

    Earns themquoted in the report

    word1

    Examiners were instructed not to allow variable names with spaces or names that differed from those in the question.

    OCR J277/02 Examiners' report, Summer 2024.

  • Flowcharts or structured English in Section B

    Where responses were presented as flowcharts or structured English in Section B, no marks were given. Section B wants Exam Reference Language or a high-level language.

    OCR J277/02 Examiners' report, Summer 2024.

  • Off by one with a 0-indexed array

    A common misconception was to compare a stack pointer with 20 instead of 19, showing limited understanding of zero-indexing.

    OCR H446/02 Examiners' report, Summer 2025.

  • Code after return never runs

    Lost marksour example

    return stack[pointer]
    pointer = pointer - 1

    Earns themour example

    pointer = pointer - 1
    return stack[pointer + 1]

    Many candidates returned the top value and then decremented the pointer, so the decrement never ran.

    OCR H446/02 Examiners' report, Summer 2025.

  • Procedure or function, decided by the return value

    A getter written as a procedure lost marks because a getter must return a value, and a module declared as a function when it returned nothing lost the first mark. Strings "True" and "False" were also used where Booleans were needed.

    OCR H446/02 Examiners' report, Summer 2024.

Cambridge International 9618 pseudocode9 slips

  • Joining strings with + instead of &

    Lost marksour example

    Name ← First + " " + Last

    Earns themour example

    Name ← First & " " & Last

    Listed among the common mistakes on a string-processing question, alongside using Length as an identifier and treating a string as an array.

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/22, Question 6(a).

  • Dropping the arrow from FOR, or writing LEN()

    Lost marksquoted in the report

    FOR index 1 to LENGTH(Line)

    Earns themour example

    FOR Index ← 1 TO LENGTH(Line)

    The examiners name the missing assignment arrow as a common mistake and add that LEN() was seen several times. Cambridge's function is LENGTH().

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/22, Question 8(b).

  • Writing CALL in front of a function

    Lost marksquoted in the report

    CALL GetStat(Flag)

    Earns themour example

    Flag ← GetStat()

    The guide says CALL is for procedures only and a function is called as part of an expression. The report also lists GetStat() → Flag.

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/22, Question 2(b).

  • Reserved words as variable names

    Lost marksquoted in the report

    DECLARE String : STRING
    DECLARE Input : STRING

    Quoted by the examiners as invalid pseudocode that lost marks. Keywords, including data type names, must never be identifiers.

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/22 and 9618/23, general comments.

  • Half a condition

    Lost marksquoted in the report

    Num1 > Num2 AND Num3

    Earns themour example

    Num1 > Num2 AND Num1 > Num3

    Each side of AND must be a complete comparison. The report also saw Num1 > Num2, Num3.

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/22, Question 2(a).

  • Brackets and the multiplication sign

    Lost marksquoted in the report

    Average ← Num1 + Num2 + Num3/3
    IF Side1 X Side1 = Side2 X Side2 + Side3 X Side3 THEN

    Earns themquoted in the report

    Average ← (Num1 + Num2 + Num3)/3
    IF Side1 * Side1 = Side2 * Side2 + Side3 * Side3 THEN

    Both printed in the report as wrong and right pairs.

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/22, general comments.

  • Python habits in file handling

    Lost marksquoted in the report

    FOR Line IN InputFile
    FOR Index ← 1 to EOF(InputFile)

    Earns themour example

    WHILE NOT EOF(InputFile)
       READFILE InputFile, Line
    ENDWHILE

    Both loops are quoted as common mistakes, along with leaving the parameter out of EOF(), a missing ENDWHILE, CLOSEFILE omitted or without a file name, and quotation marks put round a file name held in a variable.

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/22 and 9618/23, file-handling questions.

  • OUTPUT where the question wants RETURN

    Raised on 9618/21 and again in the general comments for 9618/22 and 9618/23. A function hands its result back; it does not print it.

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/21, Questions 4 and 8(a).

  • Forgetting BYREF in a header

    Some candidates missed the BYREF for a module that had to change its argument, and some wrote Module instead of deciding between FUNCTION and PROCEDURE.

    Cambridge International 9618 Principal Examiner Report for Teachers, June 2024, Papers 21, 22 and 23, 9618/21, Question 7(b)(ii).

AQA pseudo-code6 slips

  • Pseudo-code keywords inside a program-code answer

    Lost marksour example

    OUTPUT bonus

    Earns themour example

    print(bonus)

    A significant number of students used the word OUTPUT rather than the correct name in their chosen language (print in Python).

    AQA GCSE Computer Science 8525/1 Report on the Examination, June 2022, Question 8.

  • Spaces inside identifiers

    Lost marksour example

    number Of Items Sold

    Earns themquoted in the report

    items

    Identifiers must be single strings with no gaps. AQA says it was forgiving in the first series and that marks may not be gained in future.

    AQA GCSE Computer Science 8525/1 Report on the Examination, June 2022.

  • / where the algorithm says DIV

    Lost marksour example

    9 / 5   gives 1.8

    Earns themour example

    9 DIV 5 evaluates to 1

    Completing a normal division instead of an integer division was a common trace-table mistake.

    AQA GCSE Computer Science 8525/1 Report on the Examination, June 2022, Question 10.

  • Quotes in an exact-output answer

    When asked for the exact output, students should not put quotes around a string, because they would not be output.

    AQA GCSE Computer Science 8525/1 Report on the Examination, June 2022, Question 9.

  • Replacing a record instead of updating a field

    Lost marksquoted in the report

    antMan ← Film('Ant-Man', '12A', 2015, True)

    Earns themquoted in the report

    antMan.beingShown ← True

    Both lines are printed in the report. The first gives the variable a completely new record; the second updates one field.

    AQA GCSE Computer Science 8525/1A-C Report on the Examination, June 2023, Question 9.

  • Loops that run once too often

    Students looped one time too many or one time too few, and struggled to index a list correctly: to compare five pairs you need four comparisons.

    AQA GCSE Computer Science 8525/1 Report on the Examination, June 2022, Question 13.2.

07

Versions, exam inserts and the quirks in the guides

Cambridge 2026 versus 2027 to 2029. We compared the guide for examination in 2026 with the guide for 2027, 2028 and 2029 line by line. The syntax is the same. The one content change fixes an example: the Cat class declared PRIVATE Breed: INTEGER and then assigned it text, and the newer guide declares it STRING.

Cambridge's guide is not what you get in the exam. The syllabus says string manipulation functions will always be given, and the June 2024 Paper 21 insert gave a different set from the guide. The insert has LEFT, TO_UPPER and TO_LOWER for whole strings, NUM_TO_STR, STR_TO_NUM, IS_NUM, ASC, CHR and date functions. The guide instead has UCASE and LCASE, which take a single character. Practise with the insert you will be given, and treat the guide as the grammar.

OCR's two documents disagree on files. In the J277 specification, writeLine on a file opened with open() writes “to the END of the file”. In the H446 appendix, openWrite() overwrites. J277 also has const, newFile(), .left(), .upper and random(), none of which are in the A Level appendix, while only H446 has byVal and byRef, classes and new.

J277 version 3.1 prints the whole language. The current GCSE specification (May 2026) has the complete Exam Reference Language table in section 3c, so GCSE students do not need the A Level appendix to learn it. One line in it reads oddly: array gameboard[8,8] is captioned as creating a 2D array “with 8 elements”, when it holds 64.

Small typos to ignore. The H446 appendix writes subString in the definition and substring in the example below it, and its switch example contains a stray case "B":1. Neither changes how an answer is marked.

08

Cheat sheets and the data behind the table

One A4 page per board, made for the inside of a revision folder: the constructs you write most, the board's rule on answers, and the slips its examiners penalise. The full table is also available as CSV and JSON for teachers who want to build their own worksheets. Please link back to this page if you reuse it.

OCR cheat sheet

GCSE J277 and A Level H446. One A4 page, PDF.

Download PDFOpen to print

Cambridge 9618 cheat sheet

AS & A Level 9618, exams 2026 to 2029. One A4 page, PDF.

Download PDFOpen to print

AQA cheat sheet

GCSE 8525 guide. One A4 page, PDF.

Download PDFOpen to print

The full table as data. 51 constructs × 4 notations, with notes and source sections. Null or “Not defined in the guide” marks a gap.

09

Which board wrote this?

Eight snippets, each one written in a single board's notation. Spotting the board from one line is the quickest test of whether the differences have stuck, and the explanation after each answer names the giveaway.

8 snippets

  1. 01
    for i=0 to 7
        print("Hello")
    next i
  2. 02
    FOR a ← 1 TO 3
       OUTPUT a
    ENDFOR
  3. 03
    OUTPUT "Summer" & " " & "Pudding"
  4. 04
    for i in range(10):
        print("Loop")
  5. 05
    SUBROUTINE add(a, b)
       RETURN a + b
    ENDSUBROUTINE
  6. 06
    do
        answer = input("New answer")
    until answer == "Correct"
  7. 07
    CALL Square(100)
  8. 08
    IF qty ≠ 7 THEN
       OUTPUT 'check'
    ENDIF
10

Questions

What is the difference between OCR, Cambridge and AQA pseudocode?

They are three separate notations. OCR's Exam Reference Language looks like Python: lower-case keywords, = for assignment, == for equality and arrays from 0. Cambridge International 9618 pseudocode uses upper-case keywords, the ← arrow for assignment, typed DECLARE statements, & to join strings and arrays whose bounds you state, usually from 1. AQA pseudo-code also uses upper-case keywords and ←, but indexes from 0, writes ≠ for not-equal and has one SUBROUTINE keyword for procedures and functions. The three also disagree on substring arguments, string length and how a FOR loop ends.

Do I have to write my exam board's pseudocode in the exam?

It depends on the board. OCR A Level says learners are not expected to memorise its pseudocode and may use any style a competent programmer could follow. OCR GCSE Section B wants Exam Reference Language or a high-level programming language, and answers in pseudocode, natural English or bullet points are not awarded marks. AQA GCSE says students may answer in any suitable format and do not need to use the AQA pseudo-code. Cambridge 9618 Paper 2 requires answers in pseudocode, and its examiners say variations with your programming language are unacceptable when pseudocode is asked for.

Can I write Python instead of pseudocode?

For OCR, yes: GCSE accepts Exam Reference Language or a high-level programming language, and Python is the usual choice. For AQA GCSE, any clear format is accepted where pseudo-code is an accepted response, but a question that asks for program code needs real code in your language, not OUTPUT. For Cambridge 9618 Paper 2, no: the question asks for pseudocode, language-specific functions that are not in the exam insert should not be used, and writing LEN() instead of LENGTH() has been called out by examiners.

Do Cambridge 9618 arrays start at 0 or 1?

Neither by default. Cambridge pseudocode states both bounds when an array is declared, for example DECLARE StudentNames : ARRAY[1:30] OF STRING, and the guide says it is good practice to state the lower bound and that generally 1 is used. Strings are also counted from 1: MID("ABCDEFGH", 2, 3) returns "BCD". OCR and AQA both index arrays and strings from 0.

Does AQA have a pseudocode guide for A-level?

No. AQA publishes a pseudo-code guide for GCSE 8525 only. The A-level 7517 specification asks students to express algorithms in pseudo-code and hand-trace them but defines no syntax. The June 2022 7517/1 paper printed pseudo-code close to the GCSE style with some differences: FUNCTION ... ENDFUNCTION instead of SUBROUTINE, FOR EACH N IN, and LENGTH() rather than LEN().

Which string functions does Cambridge give you in the exam?

The Paper 2 insert, not the guide, is what you have in the room. The June 2024 9618/21 insert supplied LEFT, RIGHT, MID, LENGTH, TO_UPPER, TO_LOWER, NUM_TO_STR, STR_TO_NUM, IS_NUM, ASC, CHR, INT, RAND, EOF and date functions such as DAY, MONTH, YEAR and TODAY, plus the MOD and DIV operators. The guide itself has no LEFT, ASC or CHR, and its UCASE and LCASE take a single character. The syllabus says string manipulation functions will always be given.

Is OCR the same as Cambridge International?

No. OCR, now branded Cambridge OCR, is the UK board behind GCSE J277 and A Level H446, and its notation is Exam Reference Language. Cambridge International (CAIE) sets AS and A Level 9618 and IGCSE, with its own and quite different pseudocode. Both sit under Cambridge University Press & Assessment, so go by the specification code rather than the word Cambridge.

Did the Cambridge pseudocode guide change for 2027 to 2029?

Not in its syntax. Comparing the guide for examination in 2026 with the guide for 2027, 2028 and 2029, the constructs, keywords and examples are the same. The one content change is a corrected example: the Cat class declared its Breed attribute as INTEGER while assigning it text, and the newer guide declares it as STRING.

Sources

Checked against the boards' documents, with versions

Boards revise these documents. If anything here disagrees with the current version of a guide, the guide is right, and I would like to hear about it so the page can be corrected. For the OCR notation in more depth, with a worked example for every construct, see the complete OCR Exam Reference Language guide.

Moving between boards is where the marks leak

Most students who lose marks on pseudocode know the logic. They learned one notation from a textbook, another from a revision video and a third from Python, and the exam catches the join. A lesson fixes that on your own past-paper answers: which habit belongs to your board, and which one to drop.

I teach GCSE (OCR, AQA and Edexcel), Cambridge IGCSE and A-Level, including Cambridge 9618 Computer Science, online.