Project 1 English Dictionary App
import json
p = open("data.json",'r+')
data = json.load(p)
def meaning(w):
w = w.lower()
if w in data:
return data[w]
else:
return "The word doesn't exist. Please double check it."
print (" :: Welcome to the Main Menu :: ")
def option():
options = int(input("Enter the option number : \n \
1: Add new word \n \
2: find the meaning \n \
3: Update a word : \n \
4: Exit\n \
Option: "))
if options == 1:
print (("a"))
elif options == 2:
word = input("Enter the word :")
means = meaning(word)
print (means)
elif options == 3:
print ("b")
elif options == 4:
print ("Exited")
option()
p.close()