QuestionQ9

Data Serialization

Which Python data type represents an unordered collection of unique elements?

  • A tuple
  • B dictionary
  • C set
  • D list
Explanation

In Python, the set data type is specifically designed to store an unordered collection of unique, hashable items — duplicate values are automatically discarded, and elements have no defined order or index. This distinguishes it from list and tuple, which are ordered and allow duplicates, and from dictionary, which stores unique keys mapped to values rather than a simple collection of unique elements.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!