1. Home
  2. Data Science
  3. Python
  4. Which collection can be used as a dictionary key in Python?

Added 25 Nov 2026

Which collection can be used as a dictionary key in Python?

  1. list
  2. set
  3. dict
  4. tuple of immutable items Correct answer

Correct answer

D. tuple of immutable items

5 views

MCQSEXAM

Explanation

Dictionary keys must be hashable; tuples of hashable items qualify.

Reference

Asked in: Python Interview Tuples

https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs