In Python, a dictionary can use immutable data types, like strings and tuples, as keys but not _______.

  • Arrays
  • Dictionaries
  • Lists
  • Sets
In Python, dictionaries can use immutable data types, such as strings and tuples, as keys because they are hashable and can be used to create unique hash values. However, lists are mutable, and their contents can change, so they cannot be used as dictionary keys.
Add your answer
Loading...

Leave a comment

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