A hashable type supports the hash function, so its values can serve as dictionary keys. Hashing helps keep keys unique and makes lookup fast rather than requiring a sequential search. section 4.1
Why hashing speeds lookup
Searching a string, list, or tuple may examine values one by one, taking O(n) time. A dictionary uses a hash-based location, analogous to sending visitors directly to an office by the first letter of a surname, giving approximately O(1) lookup. section 4.1
Keep these dictionary rules in mind:
- Keys must be hashable, such as numbers or strings. section 4.23
- Values can contain anything, including another dictionary. section 4.23
- Keys are unique, and they can be iterated with loops or comprehensions. section 4.23


