Python hash table: dict (key → value)

Goal A hash table maps each key to a value and finds it in O(1) average time by hashing the key. Run the program and predict the map and each read; the code shows the actual Python call.
read result:
each key is hashed to locate its slot — no scanning
set / update get / membership delete

New to hash tables? Learn the fundamentals in the Foundation Course →