Pseudocode array to Python list
A pseudocode array starting at index 1 becomes a Python list starting at 0, so element Scores[i] is written scores[i - 1] in Python.
Understanding Pseudocode array to Python list in IGCSE Computer Science Paper 2
What it does: Scores[1] in pseudocode is the first element, which is scores[0] in Python. range(5) gives 0, 1, 2, 3, 4, which are the five valid Python indices for a list of 5 elements. Python lists start at index 0, so pseudocode index 1 becomes Python index 0. range() stops before its end value, so range(1, 6) gives 1 to 5. Then use scores[i - 1] inside the loop. Indexes run from 0 to 4. Index 5 would cause an IndexError. It matches pseudocode Scores[5]. A pseudocode array with bounds 1 to 5 holds 5 values, so the Python list is created with 5 items using [0] * 5.
Common mistakes: Pseudocode index i starts at 1, but Python lists start at 0, so the element is scores[i - 1]. Using scores[i] gives an IndexError when i is 5. Marks[1] is the first element in pseudocode, which is index 0 in Python. marks[1] is the second element. It should be marks[0].
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 216–231) and word search (Modules 188–231).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
scores[i - 1]Fill in the Blanks
Spot the Error
Student with a class code? Join your class →