Skip to content

Commit b1c093e

Browse files
authored
Add files via upload
1 parent 0f339fb commit b1c093e

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
from PyDictionary import PyDictionary
2+
3+
# A simple word dictionary program
4+
5+
dictionary = PyDictionary()
6+
7+
8+
9+
def Synonym(word):
10+
print(dictionary.synonym(word))
11+
12+
def Antonym(word):
13+
print(dictionary.antonym(word))
14+
15+
def Quit():
16+
print('Thanks for using this software...😁👌')
17+
18+
def Meaning(word):
19+
print(dictionary.meaning(word))
20+
21+
22+
def Main():
23+
24+
options = (1, 2, 3)
25+
26+
print('A Simple Word Dictionary Program')
27+
28+
while True:
29+
30+
print('Menu \n 1. Get Meanings 2. Get Synonyms 3. Get Antonyms 4. Quit')
31+
32+
33+
user_choice = None
34+
try:
35+
user_choice = int(input('Enter a choice: '))
36+
37+
38+
if user_choice in options:
39+
word = input('Enter a word: ')
40+
if user_choice == 1:
41+
Meaning(word)
42+
elif user_choice == 2:
43+
Synonym(word)
44+
else:
45+
Antonym(word)
46+
elif user_choice == 4:
47+
Quit()
48+
break
49+
else:
50+
print('Enter a choice(1-4)')
51+
52+
except ValueError:
53+
print('Invalid Option!')
54+
55+
print('')
56+
57+
58+
59+
60+
61+
62+
63+
Main()

0 commit comments

Comments
 (0)