Revise Computing
Revision notesQuestionsFor schools
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Supplementary programming practice/Output and Sequence

Sequence execution

301.1 Output and Sequence

Practise exam questions

Output and Sequence — Note 3 of 3

Predict order that statements run.

What you need to know

Python executes statements from top to bottom, one at a time. The order matters — using a variable before it is assigned causes an error.

What to know

  • Code runs line by line, top to bottom
  • Each line finishes before the next starts
  • If you reassign a variable, only the new value is used after that point
  • Moving a line changes the program's behaviour

Code examples

Sequence matters
python
x = 5
x = x + 1
print(x)  # 6, not 5

# Swapping order would give a different result
← Previous noteLiterals vs variables301.1 Output and SequenceNext topic →Arithmetic operators301.2 Arithmetic Operators

Back to Output and Sequence

Specification notes for programming are in Paper 2.

Output and Sequence

Note 3 of 3

  1. 1Basic print / output
  2. 2Literals vs variables
  3. 3Sequence execution
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).