← Python

Enumerations – Practical Use

Enum members are used as meaningful, type-safe constants instead of raw strings or numbers

Understanding Enumerations – Practical Use in Python

What it does: + creates a new tuple containing all items from both tuples. count() is one of the few methods tuples support. Adding two tuples joins them into a new tuple - the result keeps the tuple type. Multiplying repeats the whole tuple - 3 copies of (1,2) joined together. count() tells you how many times a value appears - 2 appears twice in this tuple. index() returns the position (index), not the value - 20 is at position 1. Tuples are minimal - only count() and index() because they can't be changed. sorted() always returns a list even when you pass it a tuple.

Common mistakes: Tuples don't have sort(). Use sorted() and convert back. Must concatenate with a tuple: (4,) not just 4.

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 51–63) and word search (Modules 41–63).

Take this worksheet further — free with Cloodit

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

Learning
Duo
(1,2) + (3,4) returns?
(1, 2, 3, 4)[1, 2, 3, 4]
Matches
❌ t.append(4)
↓
Error: Tuples have no append method
Applying
Meanings
Term
Concatenation (+)
Meaning
Combines two tuples into a new tuple.
Practice
t1 = (1, 2)
Testing
Gaps
t = (1, 2) (3, 4)
Check Answer
Spots
1t = (3, 1, 2)
2t.sort()

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

The 'Void Whale' badge — Definition Drifter, 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. (1,2) + (3,4) returns?
A. [1, 2, 3, 4]
B. (1, 2, 3, 4) ✓
Adding two tuples joins them into a new tuple - the result keeps the tuple type
2. (1,2) * 3 returns?
A. (1, 2, 1, 2, 1, 2) ✓
B. (3, 6)
Multiplying repeats the whole tuple - 3 copies of (1,2) joined together
3. t = (1,2,2,3)\nt.count(2) returns?
A. 2 ✓
B. 1
count() tells you how many times a value appears - 2 appears twice in this tuple
4. t = (10,20,30)\nt.index(20) returns?
A. 1 ✓
B. 20
index() returns the position (index), not the value - 20 is at position 1
5. How many methods do tuples have?
A. Many like lists
B. Just 2: count() and index() ✓
Tuples are minimal - only count() and index() because they can't be changed

Match the Pairs

t.append(4) → Error: Tuples have no append method
t.remove(1) → Error: Tuples are immutable — no remove method
(1, 2) + (3, 4) → Valid: Concatenate two tuples into one
t.count(2) → Ok: Count how many times 2 appears in t
(1, 2) * 2 → Output: (1, 2, 1, 2)
sorted((3, 1, 2)) → Output: [1, 2, 3]

Key Term

Concatenation (+)
Combines two tuples into a new tuple.~~Repetition (*)

Fill in the Blanks

1. t = (1, 2) + (3, 4)
2. t = (1, 2) * 3
3. t = (1, 2, 2, 3) print(t.count(2))
4. t = (10, 20, 30) print(t.index(20))
5. t = (3, 1, 2) print(sorted(t))

Spot the Error

Question 1
A t = (3, 1, 2)
B t.sort()
C print('Sorted:', t)
D print('Done')
Line B — Tuples don't have sort(). Use sorted() and convert back.
Question 2
A t = (1, 2, 3)
B t += 4
C print('Tuple:', t)
D print('Done')
Line B — Must concatenate with a tuple: (4,) not just 4
Question 3
A t = (1, 2, 3)
B idx = t.index(5)
C print('Index:', idx)
D print('Done')
Line B — index() raises ValueError if value isn't in the tuple
Question 4
A t = (3, 1, 2)
B result = sorted(t)
C print('Sorted:', result)
D # expects tuple
Line B — sorted() returns a list. Wrap in tuple() to get a tuple back.
Question 5
A t = (1, 2) + [3, 4]
B label = 'Combined'
C print('Combined:', t)
D print('Done')
Line A — Can't concatenate tuple + list. Both must be the same type.

Student with a class code? Join your class →