Last reviewed
Correct answer: C. A list is mutable, while a tuple is immutable
Explanation
Both types hold an ordered sequence and accept any kind of item, so the difference that matters is what you may do to them afterwards. The reference says: "Lists are mutable sequences, typically used to store collections of homogeneous items". The tutorial gives the other half: "It is not possible to assign to the individual items of a tuple, however it is possible to create tuples which contain mutable objects, such as lists."
That property settles two decisions you will face. Dictionary keys and set members must be hashable, and "Hashability makes an object usable as a dictionary key and a set member, because these data structures use the hash value internally" — so a coordinate pair works as a key when it is a tuple and raises TypeError as a list. A tuple passed to another function also cannot be edited behind your back, which is why a mutable default argument is a classic Python bug and a tuple is not.
The other options invent rules Python does not have: no size ceiling separates them, lists hold numbers constantly, and a tuple may carry any number of items.
Sources
“Lists are mutable sequences, typically used to store collections of homogeneous items”
“It is not possible to assign to the individual items of a tuple, however it is possible to create tuples which contain mutable objects, such as lists.”
“Hashability makes an object usable as a dictionary key and a set member, because these data structures use the hash value internally.”
Practise 3 questions on this topic
Take Python Data Structures — Timed Test (3 questions) — scored instantly, explanation for every question, no login.