← Python

Enumerations – Basics

An Enum class defines a fixed set of named constants that each have a name and a value

What it does: Tuples are ordered, immutable sequences defined with parentheses. Tuple unpacking assigns each value to a variable in order. Tuples are like lists but cannot be changed after creation. The comma makes it a tuple — (1,) is a tuple, (1) is just parentheses around 1. Immutable means once created, the items cannot be added, removed, or changed. Indexing a tuple returns the item at that position — t[0] is the first item, 1. Immutability signals intent — use a tuple when the data is fixed (coordinates, RGB values). len() counts the number of items — there are 3 items in this tuple.

Common mistakes: Tuples are immutable: can't change items. Create a new tuple instead. Tuples don't have append(): they're immutable.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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.

Learning
Duo
What is a tuple?
An immutable ordered sequenceA mutable list
Matches
❌ t = (1)
Error: Single item needs trailing comma: (1,)
Applying
Meanings
Term
Tuple
Meaning
An immutable ordered sequence created with parentheses.
Practice
point = (3, 4)
Testing
Gaps
print(point[])
Check Answer
Spots
1t = (1, 2, 3)
2t[0] = 99

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

The 'Flamingo' badge — Balanced Coder, 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. What is a tuple?
A. An immutable ordered sequence ✓
B. A mutable list
Tuples are like lists but cannot be changed after creation
2. How do you create a tuple?
A. Square brackets []
B. Parentheses () or commas ✓
The comma makes it a tuple — (1,) is a tuple, (1) is just parentheses around 1
3. Can you change a tuple's items?
A. No tuples are immutable ✓
B. Yes
Immutable means once created, the items cannot be added, removed, or changed
4. t = (1, 2, 3)\nt[0] returns?
A. (1)
B. 1 ✓
Indexing a tuple returns the item at that position — t[0] is the first item, 1
5. How do you create a single-item tuple?
A. (1,) with a trailing comma ✓
B. (1)
(1) is just 1 in brackets — the trailing comma is what makes it a tuple

Match the Pairs

t = (1) Error: Single item needs trailing comma: (1,)
t[0] = 5 Error: Tuples are immutable — cannot assign
t = (1, 2, 3) Valid: Tuple with three items
a, b = (10, 20) Ok: Unpack a tuple into two variables
(1, 2, 3)[1] Output: 2
len((4, 5, 6, 7)) Output: 4

Key Term

Tuple
An immutable ordered sequence created with parentheses.~~Immutable

Fill in the Blanks

1. point = (3, 4) print(point[0])
2. single = (42,) # single-item tuple
3. a, b = (10, 20) print(b)
4. t = (1, 2, 3) print(len(t))
5. print(2 in (1, 2, 3))

Spot the Error

Question 1
A t = (1, 2, 3)
B t[0] = 99
C print('Updated:', t)
D print('Done')
Line B — Tuples are immutable: can't change items. Create a new tuple instead.
Question 2
A t = (1, 2, 3)
B t.append(4)
C print('Tuple:', t)
D print('Done')
Line B — Tuples don't have append(): they're immutable
Question 3
A single = (42)
B print('Type:', type(single))
C print('Value:', single)
D # expects tuple
Line A — (42) is just the number 42. Need trailing comma: (42,) for a tuple.
Question 4
A coords = (1, 2, 3)
B a, b = coords
C print('a:', a, 'b:', b)
D print('Done')
Line B — 3 values but only 2 variables: need matching count for unpacking
Question 5
A t = (1, 2, 3)
B first = t(0)
C print('First:', first)
D print('Done')
Line B — Use square brackets for indexing: t[0] not t(0)
For Teachers

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.

For Students

Practice this topic interactively, track progress, and unlock badges.

Start Learning Free →

Have a class code?