In the OCR GCSE Computer Science course, you are expected to understand and write pseudocode—a way of describing how a program works using plain, logical steps. OCR pseudocode isn’t a real programming language like Python; it’s a simplified format designed to focus on thinking like a programmer without worrying about perfect syntax. You’ll see pseudocode used in exams to explain algorithms, test your understanding of code logic, and ask you to complete or write code in this simplified style.
Although OCR pseudocode looks different from Python, the two share many similarities. Both use variables, loops, conditions, inputs, and outputs—but OCR pseudocode has its own structure and keywords (like OUTPUT, INPUT, ENDIF, REPEAT, etc.). In real programming, you use Python to make actual programs run; in pseudocode, you're focusing on communicating your logic clearly. Learning to switch between both helps you become a better problem-solver and prepares you for answering exam questions confidently.
In both OCR pseudocode and Python, variables are used to store data. Python uses = just like pseudocode. No data types need to be declared in either.
OCR Pseudocode
x = 5
name = "Kiers"
Python
x = 5
name = "Kiers"
Pseudocode uses INPUT and OUTPUT. Python uses input() and print(). Python also requires brackets and quotation marks for strings.
OCR Pseudocode
INPUT name
OUTPUT "Hello " + name
Python
name = input()
print("Hello " + name)
Both languages use IF statements to make decisions. OCR pseudocode uses THEN, ENDIF, and indentation. Python uses colons : and no ENDIF.
OCR Pseudocode
IF age >= 18 THEN
OUTPUT "Adult"
ELSE IF age >= 13 THEN
OUTPUT "Teenager"
ELSE
OUTPUT "Child"
ENDIF
Python
if age >= 18:
print("Adult")
elif age >= 13:
print("Teenager")
else:
print("Child")
FOR loops repeat a fixed number of times. In pseudocode, FOR i = 1 TO 5 includes both 1 and 5. In Python, range(1, 6) is needed to include 5.
OCR Pseudocode
FOR i = 1 TO 5
OUTPUT i
NEXT i
Python
for i in range(1, 6):
print(i)
WHILE loops run as long as a condition is true. Both use the condition at the top. Pseudocode ends with ENDWHILE; Python uses indentation and :
OCR Pseudocode
WHILE answer != "yes"
INPUT answer
ENDWHILE
Python
while answer != "yes":
answer = input()
This loop runs at least once, checking the condition after running. Python has no built-in REPEAT UNTIL, so we use a while True with break.
OCR Pseudocode
REPEAT
INPUT number
UNTIL number > 0
Python
while True:
number = int(input())
if number > 0:
break
Functions return values. Pseudocode uses FUNCTION and RETURN; Python uses def and a colon. Python needs () and indentation.
OCR Pseudocode
FUNCTION square(x)
RETURN x * x
ENDFUNCTION
Python
def square(x):
return x * x
Procedures are like functions but do not return a value. In pseudocode, use PROCEDURE and ENDPROCEDURE; in Python, use def and call with the name and brackets.
OCR Pseudocode
PROCEDURE greet(name)
OUTPUT "Hello " + name
ENDPROCEDURE
Python
def greet(name):
print("Hello " + name)
Both languages use list indexing starting from 0. Python uses square brackets [] for both declaring and accessing items.
OCR Pseudocode
names = ["Ali", "Ben", "Cara"]
OUTPUT names[0]
names[2] = "Chloe"
FOR i = 0 TO 2
OUTPUT names[i]
NEXT i
Python
names = ["Ali", "Ben", "Cara"]
print(names[0])
names[2] = "Chloe"
for i in range(0, 3):
print(names[i])