Sets – Operations
Sets support mathematical operations: union |, intersection &, difference -, and subset tests
What it does: people[0] gets the first dict, then ['name'] gets its name value. d['nums'] returns the list, then .append() adds to it. Think of it as a table — each dict is a row with named columns. Lists hold multiple records; dicts give each record named fields. .add() is for sets; lists use .append() to add items. Dict values can be any Python object — strings, numbers, lists, even other dicts. d['tags'] is the list ['python', 'code'] — len() of that list is 2. The value is a list, so use an integer index: d['tags'][0], not d['tags']['a'].
Common mistakes: people is a list: must index first: people[0]['name']. Dicts use keys not indices. Use ['name'] not [0].
Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.
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 of dictsFill in the Blanks
Spot the Error
Create a free class, add this module to a journey, and track who's stuck.
Create a free teacher account →No credit card. No setup fee. Make a class and invite students in under three minutes.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →