Skip to content
AgileLogics
3 min read

Tuples

Prerequisites: Lists

A tuple is an ordered collection like a list, but immutable — once created, it can't be changed. Written with parentheses instead of brackets.

point = (3, 4)
x, y = point   # "unpacking" into two variables
print(x, y)

Expected output

3 4

Use a tuple for a fixed, small group of values that shouldn't change — coordinates, an RGB color, a fixed record.