Skip to content

Instantly share code, notes, and snippets.

@AdamGold
Last active March 24, 2019 16:13
Show Gist options
  • Save AdamGold/34a0777159b941b654788fd6cc946e53 to your computer and use it in GitHub Desktop.
Save AdamGold/34a0777159b941b654788fd6cc946e53 to your computer and use it in GitHub Desktop.
table = HashTable()
names = [
"Eden Marriott",
"Sebastian Frame",
"Cassia Hicks",
"Bert Blankenship",
"Clarence Hughes",
"Clay Burch",
"Linda Holmes",
"Felix Galloway",
"Matas Hickman",
"Wilma Michael",
]
values = [4, 1, 6, 9, 3, 10, 50, 2, 0, 99]
for index, name in enumerate(names):
table[name] = values[index]
print(table["Eden Marriott"]) # 4
print(table["Wilma Michael"]) # 99
print(table["fizz"]) # KeyError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment