Intermediate Topic 22 of 54 Programming Fundamentals
Tuples
Fixed-size immutable ordered groupings of values.
How it works
A tuple groups a fixed number of values, typically immutable, and allows unpacking such as x, y = point. Immutability makes tuples safe as dictionary keys.
Where it is used
Returning multiple values, coordinates, records.
Common pitfall
Trying to modify a tuple raises an error; for evolving data use a list or object.
Where it fits in the course
Tuples is topic 22 of 54 in Programming Fundamentals, rated Intermediate. It follows Sets. The next topic is Recursion.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Programming Fundamentals quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Programming Fundamentals quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Tuples?
Fixed-size immutable ordered groupings of values. It belongs to Programming Fundamentals and is an intermediate-level topic.
Where do people use Tuples?
Returning multiple values, coordinates, records.
What is the most common mistake with Tuples?
Trying to modify a tuple raises an error; for evolving data use a list or object.
What should I learn before this topic?
Start with Sets, the topic just before it in Programming Fundamentals.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Programming Fundamentals quiz.
Is Tuples hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Tuples?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Tuples?
Sets, Recursion, Dictionaries and Maps are closely connected. The full list is in the related topics section of this page.
What should I study after Tuples?
Continue with Recursion, the next topic in Programming Fundamentals.
Related topics
- Sets (Programming Fundamentals)
- Recursion (Programming Fundamentals)
- Dictionaries and Maps (Programming Fundamentals)
- Base Case (Programming Fundamentals)