Skip to content

Instantly share code, notes, and snippets.

@abhi923
Created June 22, 2020 08:56
Show Gist options
  • Save abhi923/3321ab7c4604ac34554dd05a44508cd8 to your computer and use it in GitHub Desktop.
Save abhi923/3321ab7c4604ac34554dd05a44508cd8 to your computer and use it in GitHub Desktop.
dictionary = {"cat" : "chat", "dog" : "chien", "horse" : "cheval"}
phone_numbers = {'boss' : 5551234567, 'Suzy' : 22657854310}
empty_dictionary = {}
words = ['cat', 'lion', 'horse', 'RAT']
for word in words:
if word in dictionary:
print(word, "->", dictionary[word])
else:
print(word, "is not in dictionary")
print(dictionary)
print(phone_numbers)
print(empty_dictionary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment