TutorSyntax • Free Computer Science revision

Pseudocode vs Python: Understand Exam Questions

Already know Python? Learn how to read OCR and AQA pseudocode without learning a second programming language from scratch. Worked comparisons, trace tables and exam-style practice.

Pseudocode and Python side by side, connected by an arrow to show the same algorithm in different notation.

Why does pseudocode confuse Python students?

You may have spent two years learning Python, then open an exam paper and see IF, OUTPUT, a left arrow or ENDIF. It can look like an unfamiliar programming language. Usually it is not a new algorithm: it is a different way of describing a familiar algorithm.

Pseudocode is a human-readable way of writing the steps of an algorithm without committing to the exact syntax of a programming language. Python is an executable programming language: the computer enforces its grammar and punctuation. Exam boards use reference notations so students taught different languages can understand the same question.

Read the exam instruction before writing anything

Not every exam question accepts the same answer format. This distinction can cost marks even when a student's idea is correct.

SpecificationWhat you may seeWhat to remember
OCR GCSE J277OCR Exam Reference Language (ERL) in Paper 2 questions.Section A often allows flexible descriptions. In certain Section B programming tasks, you must write recognisable ERL or a high-level programming language such as Python; informal pseudocode is not sufficient when code is required.
AQA GCSE 8525AQA standard pseudocode in algorithm questions; Python code in language-specific programming contexts.Read the command carefully: the question may ask for pseudocode, program code or a flowchart. Respond in the form requested. If pseudocode is permitted, AQA does not require your answer to copy its exact house style.
OCR A-level H446Reference pseudocode in written assessments.OCR states that candidates need not memorise its pseudocode syntax. A clearly understandable alternative pseudocode style can be acceptable when pseudocode is requested.
AQA A-level 7517Programming-language code and algorithms, including skeleton-program tasks on Paper 1.Do not assume GCSE pseudocode conventions govern every A-level task. Check whether you are expected to write, amend or explain code in your chosen programming language.

Official guidance: OCR J277 specification — programming assessment, AQA GCSE programming specification, OCR H446 specification and AQA A-level assessment overview. The tables and examples below are independently written TutorSyntax learning examples, not reproduced examination questions.

Translate the notation, not the algorithm

Start by recognising the purpose of each statement: assign a value, read input, display output, compare two values, make a choice or repeat a process. The table is a quick teaching aid—always consult your exam board's current reference sheet for its full syntax.

MeaningPythonOCR GCSE styleAQA GCSE style
Assign a valuescore = 5score = 5score ← 5
Test for equalityscore == 5score == 5score = 5 in a condition
Display a resultprint(score)print(score)OUTPUT score
Read user inputinput()input(...)USERINPUT
Start selectionif x > 3:if x > 3 thenIF x > 3 THEN
Close selectionDedentendifENDIF
Count-controlled loopfor i in range(...):for i = 1 to 4 … nextFOR i = 1 TO 4 … ENDFOR
Condition-controlled loopwhile ...:while ... … endwhileWHILE ... … ENDWHILE
Remainder%MODMOD
Integer division// for typical positive integersDIVDIV

The DIV comparison is a useful first approximation for the non-negative integer examples used here. Python's // has specific floor-division rules for negative values; do not treat the notations as universally identical for every language and data type.

Three worked examples: same logic, different notation

Read the examples from left to right. Say aloud what is assigned, which comparison is made and when a variable changes. The pseudocode columns illustrate the boards' styles using our own simple algorithms.

Selection — choosing between outcomes

Python 3

mark = 64
if mark >= 50:
    print("Pass")
else:
    print("Try again")

Runnable example

OCR GCSE J277 — ERL style

mark = 64
if mark >= 50 then
    print("Pass")
else
    print("Try again")
endif

Illustrative OCR-style notation

AQA GCSE 8525 — pseudocode style

mark ← 64
IF mark ≥ 50 THEN
    OUTPUT "Pass"
ELSE
    OUTPUT "Try again"
ENDIF

Illustrative AQA-style notation

In Python, : starts each indented block. The OCR reference-language style marks an if block with then and endif. The AQA style capitalises the keywords and uses a left-arrow for assignment. All three display Pass.

Count-controlled loops — pay attention to the endpoint

Python 3

for number in range(1, 5):
    print(number)

Runnable example

OCR GCSE J277 — ERL style

for number = 1 to 4
    print(number)
next

Illustrative OCR-style notation

AQA GCSE 8525 — pseudocode style

FOR number = 1 TO 4
    OUTPUT number
ENDFOR

Illustrative AQA-style notation

All three examples display 1, 2, 3, 4. Python’s range(1, 5) stops before 5. These to 4 reference-language loops include 4. This is one of the highest-value distinctions to practise.

Condition-controlled loops — track the changing variable

Python 3

total = 0
while total < 6:
    total = total + 2
print(total)

Runnable example

OCR GCSE J277 — ERL style

total = 0
while total < 6
    total = total + 2
endwhile
print(total)

Illustrative OCR-style notation

AQA GCSE 8525 — pseudocode style

total ← 0
WHILE total < 6
    total ← total + 2
ENDWHILE
OUTPUT total

Illustrative AQA-style notation

The condition is checked before each repetition. The values become 2, 4 and 6, then the condition is false. Each version displays 6.

Seven traps students can avoid

  1. Forgetting that Python stops early: range(1, 5) generates 1–4, not 1–5. Check whether a pseudocode TO endpoint is included.
  2. Confusing assignment and comparison: a left arrow gives a variable a value; == in Python tests if two values are equal.
  3. Reading the variable once and stopping: in loops, trace how its value changes every iteration.
  4. Missing block endings: ENDIF, ENDWHILE, ENDFOR or next can replace the block boundaries shown by Python indentation.
  5. Treating pseudocode as runnable Python: OUTPUT and USERINPUT are not Python functions.
  6. Assuming every answer may be written in English: obey a request for a high-level program or OCR ERL in a syntax-assessed task.
  7. Ignoring data types: Python input() returns text. Numeric calculations usually need conversion, such as int(input(...)).

Worked trace table — read the values, not the vocabulary

The following is an original AQA-style teaching example. What value does it display?

total ← 1
FOR count = 1 TO 3
    total ← total + count
ENDFOR
OUTPUT total
StagecounttotalWhy?
Initial value—1Variable assigned
Iteration 1121 + 1
Iteration 2242 + 2
Iteration 3374 + 3
Final output—7Loop complete

Python translation:

total = 1
for count in range(1, 4):
    total = total + count
print(total)  # 7

Try an original exam-style practice question

Choose a board to practise recognising the different notation. These are TutorSyntax questions, not official or past-paper questions. Feedback explains the logic as well as the correct answer. No account is needed and answers are not uploaded.

Loading original practice questions…

Written translation challenge — 4 marks

Translate the following into runnable Python, preserving the same output for the same value of age.

age ← 16
IF age ≥ 16 THEN
    OUTPUT "Eligible"
ELSE
    OUTPUT "Not eligible"
ENDIF
Reveal worked Python answer and marking guidance
age = 16
if age >= 16:
    print("Eligible")
else:
    print("Not eligible")

Indicative mark points (1 each): correct assignment; correct condition; correct Python if/else structure; correct output in each branch. This is our own formative guidance, not an official mark scheme.

Output prediction — 3 marks

Trace this original OCR-style algorithm. State the displayed value, and explain why the loop stops.

points = 1
while points < 10
    points = points * 2
endwhile
print(points)
Reveal answer and reasoning

The values become 2, 4, 8 and 16. The output is 16 (1 mark); the condition is checked before each iteration (1 mark); when points is 16, points < 10 is false, so the loop stops (1 mark).

Five steps to use in an exam

  1. Underline the required format: code, pseudocode, trace table, explanation or flowchart.
  2. Identify the construct: assignment, selection, iteration, arrays or subroutine.
  3. Write down starting values: note each variable and the type of input where relevant.
  4. Trace one line at a time: ask when each condition is true and when the loop ends.
  5. Check your response: if Python code was requested, use Python syntax; if a description was requested, explain clearly and precisely.

Independent educational resource by TutorSyntax, not endorsed by OCR or AQA. This guide is designed for GCSE learners and includes short A-level notes; always follow the wording of your current exam-board specification and question paper.

Continue learning

Choose your examination specification, practise a question and check your answer. Revisit weaker topics after a few days.

Independently written TutorSyntax content; not endorsed by OCR or AQA. Always check your school’s specification and mock coverage.