Python for Data Analytics • Lesson 8
Tuples
Learn how Python tuples store ordered collections of values, access items, unpack values and understand immutability.
0 of 8 concepts completed
Complete the activity and related MCQ to unlock the next concept.
What Is a Tuple?
A tuple is an ordered collection of values, written with parentheses ( ). Like a list, it keeps its order and can hold multiple values — but once created, its items cannot be changed.
Learn by Seeing
Parentheses hold an ordered set
student = ("Aman", 21, "Python")
print(student)
# ('Aman', 21, 'Python')The order of the values is fixed, and the tuple itself is fixed.
A tuple holds multiple values in a fixed order. Edit the items:
your tuple
Each item keeps its position. Adding an index to the visual makes it clear how the tuple is ordered.
Interactive Activity
How many values does the tuple student = ("Aman", 21, "Python") contain?
Hint: Count the comma-separated items inside the parentheses.
Python Analyst Mindset
Fixed records want fixed containers
When a value should never change — a date, a coordinate, a primary key, a fixed product record — a tuple tells Python (and your teammates) that the data is locked. Immutability is a safety feature, not a limitation.
Create
Wrap values in ( ).
Read
Index with [i] or [-1].
Unpack
One variable per item.
Trust
It cannot change underneath you.
Frequently Asked Questions
Tuples — FAQs
Tuples are immutable. Use them when the data should not change — like a record or a fixed set of coordinates.
Yes. The tuple itself is fixed, but any mutable objects inside it can still be modified.
You do not — create a new tuple instead. Or convert to a list, change it, and convert back.
Python raises a ValueError. The number of variables must equal the number of items in the tuple.
Lesson Summary
What you learned
Tuples hold ordered values in one variable.
Starts at 0; -1 refers to the last item.
Items cannot be reassigned after creation.
Measure length, count occurrences, find positions.
Assign each item to its own variable in one line.
Use tuples for fixed records, lists for changeable data.