← Quiz: Tuples and Sets: all 15 questions
Quiz: Tuples and Sets · Question 9 of 15
Why can a tuple be a dictionary key but a list cannot?
Why can a tuple be a dictionary key but a list cannot?
- A.Tuples are smaller
- B.Tuples are immutable (hashable); lists can change
- C.Lists can't hold numbers
- D.It's only a convention
Answer & explanation
Correct answer: Tuples are immutable (hashable); lists can change
Keys must not change after insertion.
Can you get the rest right without peeking?
Take the timed Quiz: Tuples and Sets quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →