-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdictionary.py
More file actions
16 lines (12 loc) · 771 Bytes
/
dictionary.py
File metadata and controls
16 lines (12 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'''
Create a short dictionary: e.g Finnish to English. Add some wordpairs to a list.
'''
dictionary = [["cat", "kissa"], ["dog", "koira"], ["mouse", "hiiri"], ["elephant", "norsu"], ["guinea pig", "marsu"], ["parrot", "papukaija"], ["gold fish", "kultakala"], ["horse", "hevonen"], ["cow", "lehmä"], ["sheep", "lammas"], ["bird", "lintu"], ["bunny", "pupu"], ["fox", "kettu"], ["elk", "hirvi"], ["reindeer", "poro"]]
print("There are some common animals listed on this dictionary.")
animal = input("Search for an animal: \n").lower()
result = f"Couldn't found {animal} in the dictionary"
for i in range(len(dictionary)):
for j in range(len(dictionary[i])):
if animal == dictionary[i][j]:
result = f"Translation: {dictionary[i]}"
print(result)