Last active
March 24, 2019 16:13
-
-
Save AdamGold/34a0777159b941b654788fd6cc946e53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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