Recall & Review
beginner
What is a tuple in Python?
A tuple is an ordered collection of items which is immutable, meaning you cannot change its content after creation.
Click to reveal answer
beginner
What is a list in Python?
A list is an ordered collection of items which is mutable, meaning you can add, remove, or change items after creation.
Click to reveal answer
beginner
Can you change an element inside a tuple after it is created?
No, tuples are immutable. Once created, you cannot change, add, or remove elements inside a tuple.
Click to reveal answer
intermediate
Which is faster to access: tuple or list?
Tuples are generally faster to access than lists because they are immutable and have a simpler structure.
Click to reveal answer
beginner
When should you use a tuple instead of a list?
Use a tuple when you want to store data that should not change, like fixed settings or coordinates. Use a list when you need to modify the data later.
Click to reveal answer
Which of the following is immutable in Python?
✗ Incorrect
Tuples cannot be changed after creation, making them immutable. Lists, dictionaries, and sets are mutable.
What happens if you try to change an element of a tuple?
✗ Incorrect
Trying to change a tuple element causes a TypeError because tuples are immutable.
Which data type is better when you need to add or remove items frequently?
✗ Incorrect
Lists are mutable and allow adding or removing items easily, unlike tuples.
Which of these is a correct way to create a tuple?
✗ Incorrect
Parentheses () create a tuple. Square brackets [] create a list, curly braces {} create a set, and quotes "" create a string.
Which statement is true about tuples and lists?
✗ Incorrect
Lists can be changed after creation (mutable), but tuples cannot (immutable).
Explain the main differences between tuples and lists in Python.
Think about whether you can change the data after creating it.
You got /4 concepts.
When would you choose a tuple over a list in your program?
Consider if the data should stay the same or change.
You got /4 concepts.