diff --git a/python/hash-table.py b/python/hash-table.py index 329dc57..0ecc31f 100644 --- a/python/hash-table.py +++ b/python/hash-table.py @@ -35,13 +35,14 @@ def insert_at_hash(key, value, container): existing_value = container[key_hash] +def get_at_hash(key, container): + return container[hash(key)] + + container = [None for i in range(15)] insert_at_hash("bad", "evil", container) +insert_at_hash("dab", "good", container) -container[hash("bad")] = "evil" - - -d = {"bad": "evil"} -d["bad"] +get_at_hash("dab", container)