Back to Writing
NOTESpythondata-structurestuples
Understanding Python Tuples: Etymology and Number Systems
October 7, 2020•Updated Feb 17, 2026
Understanding Python Tuples:
A tuple is an immutable sequence in Python.
Syntax:
# Creating tuples
my_tuple = (1, 2, 3)
single_element_tuple = (1,) # Note the comma
# Tuple unpacking
a, b, c = (1, 2, 3)
# Named tuples (Python 3.7+)
from collections import namedtuple
Point = namedtuple('Point', ['x', 'y'])
p = Point(x=11, y=22)
Characteristics:
- Immutable: Cannot be modified after creation
- Ordered: Elements have a specific order
- Indexable: Access elements by index
- Iterable: Can be used in loops
Use Cases:
- Returning multiple values from a function
- Using as dictionary keys (unlike lists)
- Protecting data from modification
Etymology:
The term "tuple" comes from the mathematical suffix "-tuple," denoting a sequence of elements. For example: single (1), double (2), triple (3), quadruple (4), etc.