Lesson 15 of 55
PythonData Structures – Tuples
20 minutes
Course progress27%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 15 of 55
Python20 minutes
Keep these ideas in mind as you work through the lesson.
Tuples are ordered, immutable collections. Because they cannot be changed after creation, they’re ideal for fixed groups of items (e.g., coordinates).
point = (10, 20)
# Unpack the tuple
x, y = point
print('x =', x, ', y =', y)
# Single‑element tuple needs a trailing comma
single = (42,)
print(single)
Even though you can’t modify a tuple, you can concatenate or repeat them to produce new tuples.