← IGCSE Computer Science Paper 1

Interpreter

A translator that translates a high-level program one line at a time and runs each line straight away. It makes no executable file, so the source code and interpreter are needed on every run.

Understanding Interpreter in IGCSE Computer Science Paper 1

What it does: Only source code and an interpreter are used. No stand-alone executable is produced, so both are needed each time. Nothing is saved from the first run, so the same lines are translated again on each run. An interpreter translates and executes each line in turn. Translating the whole program before running it is what a compiler does. An interpreter produces no executable file. Producing one is a feature of a compiler. An interpreter repeats the translation on every run because it does not save any translated version. The line-by-line translate-and-run cycle is the key feature of an interpreter.

Common mistakes: An interpreter does not compile the whole program into a file. It reads one line at a time, so line 1 should be 'READ the first line of source'. An interpreter translates one line at a time, not every line at once. Line 2 should be 'TRANSLATE that one line'.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 430–439) and word search (Modules 419–439).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which statement describes how an interpreter works?
It translates one line, runs it, then moves to the next lineIt translates the whole program first, then runs it all at once
Matches
An interpreter translates the whole program first and then creates an executable file to run
↓
This describes a compiler. An interpreter translates and runs one line at a time and makes no executable file.
Applying
Meanings
Term
interpreter
Meaning
A translator that translates a high-level program one line at a time and runs each line straight away. It makes no executable file, so the source code and interpreter are needed on every run.
Practice
print("Translate line 1, run it")
Testing
Gaps
line in program:
Check Answer
Spots
1COMPILE all lines into a file
2TRANSLATE that line

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Jellyfish' badge — Flow Controller, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which statement describes how an interpreter works?
A. It translates one line, runs it, then moves to the next line ✓
B. It translates the whole program first, then runs it all at once
An interpreter translates and executes each line in turn. Translating the whole program before running it is what a compiler does.
2. Does an interpreter produce an executable file?
A. Yes, it saves a standalone executable file for later
B. No, it runs the code directly and makes no executable file ✓
An interpreter produces no executable file. Producing one is a feature of a compiler.
3. A student gives a friend a Python program to run using an interpreter. What must the friend have?
A. The source code and an interpreter ✓
B. Only the source code, because it is already translated
The source code is not machine code, so an interpreter must be present to translate it every time the program runs.
4. A program is run 5 times using an interpreter. How many times is the code translated?
A. 5 times, once on every run ✓
B. Once only, and the translation is reused
An interpreter repeats the translation on every run because it does not save any translated version.
5. What type of program does an interpreter translate?
A. A machine code program that is already ready to run
B. A high-level language program ✓
An interpreter translates high-level source code. Machine code needs no translation because the CPU can run it directly.

Match the Pairs

Line 1 translated -> Line 1 runs -> Line 2 translated -> Line 2 runs → An interpreter translates one line and executes it straight away, then moves on to the next line
python game.py → The interpreter is started and given the source code, so it translates and runs game.py every time
An interpreter produces no executable file, so the source code is still needed on every run → game.py + interpreter -> output (no game.exe created)
Translation repeats on every run, because the interpreter translates each line again every time the program is run → Run 1: translate lines 1-3 and run Run 2: translate lines 1-3 and run
An interpreter translates the whole program first and then creates an executable file to run → This describes a compiler. An interpreter translates and runs one line at a time and makes no executable file.
After the first run, the interpreter is no longer needed because the program has been translated → The interpreter is needed on every run, because nothing is saved and the source code is translated again each time.

Key Term

interpreter
A translator that translates a high-level program one line at a time and runs each line straight away. It makes no executable file, so the source code and interpreter are needed on every run.

Fill in the Blanks

1. for line in program: translate(line) execute(line)
Hint: Type the keyword that repeats the steps once for every line of the program.
2. for line in program: translate(line) execute(line)
Hint: Type the action an interpreter performs on a line before it can be run.
3. for line in program: translate(line) execute(line)
Hint: Type the action carried out straight after a line has been translated.
4. exeFileCreated = False
Hint: Type the Boolean value showing that an interpreter does not make an executable file.
5. runProgram(sourceCode, interpreter)
Hint: Type the name of the translator that must be supplied with the source code every time the program runs.

Spot the Error

Question 1
A COMPILE all lines into a file
B TRANSLATE that line
C RUN that line straight away
D MOVE to the next line
Line A — An interpreter does not compile the whole program into a file. It reads one line at a time, so line 1 should be 'READ the first line of source'.
Question 2
A READ next line of source code
B TRANSLATE every line at once
C RUN it straight away
Line B — An interpreter translates one line at a time, not every line at once. Line 2 should be 'TRANSLATE that one line'.
Question 3
A IF lines remain in source
B TRANSLATE the next line
C RUN the line
D ENDWHILE
Line A — The interpreter repeats translate-and-run for every line, so it needs a WHILE loop. An IF would only handle one line.
Question 4
A LOAD source and interpreter
B TRANSLATE and RUN each line
C SAVE executable file to disk
D OUTPUT results on screen
Line C — An interpreter produces no executable file. Only a compiler does that. Line 3 should say that no executable file is created.
Question 5
A print('Start')
B print('Middle')
C print('End)
Line C — The closing quote is missing, which is a syntax error. The interpreter would run lines 1 and 2, then stop and report an error at line 3. Fix: print('End').

Student with a class code? Join your class →