Choosing a data structure
Pick the structure by how you use the data: a list for an ordered collection, a dict for lookup by key, and a tuple for a fixed group of values that should not change.
Understanding Choosing a data structure in VCE Software Development U3O1
What it does: Round brackets make a tuple. An x, y point is a fixed pair of values that should not be changed. Each dictionary is one record with named fields, and the list keeps the records in order. A list is an ordered collection that can grow or change, which suits a series of scores. A dictionary lets you look up a value by its key, so phones["Mia"] gives the number straight away. Tuples are fixed, so there is no append(). A list is better when items are added or removed. Looking up a word by name and updating its count is a key lookup job, which dictionaries do best.
Common mistakes: Scores is an ordered collection that grows, so it needs a list. A tuple is fixed and has no append(), so line 2 would fail. It should be scores = [85, 92, 78]. A dictionary is looked up by key, not by position number. There is no key 0, so this causes a KeyError. It should be print(ages["Mia"]).
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 98–113) and word search (Modules 72–113).
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
list, dict, tupleFill in the Blanks
Spot the Error
Student with a class code? Join your class →