Challenge

Project 1 English Dictionary App

def display_msg():
print('Main Menu')
print('1. Add a Word')
print('2. Find The Meaning')
print('3. Update a Word')
print('4. Exit')


import json
f = open('words.txt','w')
temp = {'down':'towards','age': 'the length of that a person has lived','percentile':'100 equal groups into which a population can be divided'}
json.dump(temp,f)
f.close()


while True:
display_msg()
n = input('Enter Choice : ')
if n == '1' :
import json
f = open('words.txt','w')
word = input('Enter a word : ')
meaning = input('Enter its meaning : ')
temp[word] = meaning
json.dump(temp,f)
f.close()



elif n == '2':
f = open('words.txt','r')
Word_dict = json.load(f)
position = (input('Enter a word : '))
if position in temp :
print('Meaning is : ',temp.get(position))
else:
print('The Word not found')
f.close()




elif n == '3' :
import json
f = open('words.txt','w')
new = input('Enter a word : ')
updated_meaning = input('Enter updated meaning : ')
temp[new] = updated_meaning
json.dump(temp,f)
f.close()

elif n == '4':
print('Thanks and visit again')
break





Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.