get_at_hash()

This commit is contained in:
Emanuel Rodriguez 2023-08-10 23:39:44 -07:00
parent cd6bb7c39f
commit 835dfb6314
1 changed files with 6 additions and 5 deletions

View File

@ -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)