You need to create a data structure to hold a collection of elements, where each element has a unique key associated with it. Which Python data structure would you use?

  • Dictionary
  • List
  • Set
  • Tuple
In Python, a dictionary is the appropriate data structure for storing a collection of elements with unique keys. It allows efficient key-based access to elements, making it suitable for tasks like creating a mapping between keys and values.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *