Created
June 22, 2020 14:05
-
-
Save abhi923/c1592ca575e6e1177bf7f1534a8a523b 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
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) | |
dictionary = {"cat" : "chat", "dog" : "chien", "horse" : "cheval"} | |
for english, french in dictionary.items(): | |
print(english, "->", french) | |
dictionary = {"cat" : "chat", "dog" : "chien", "horse" : "cheval"} | |
for french in dictionary.values(): | |
print(french) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment