In this program i am making a dictionary.
When i run this program and enter 1
in the menu the program asks me to search meaning
, but when i type the word 404
(which is in the dictionary) it says Word donot exist in dictionary
. Where does this problem come from?
print("This is a dictioinary")
print("\t\t\tWelcome to Geek Translator Game")
dictionary={"404":"Message not found","googler":"person who seaches on google"}
choose=None
while(choose!=0):
choose=input('''0.Exit
1.search meaning
2.Add Word
3.Replace meaning''')
if choose is 0:
print("bye")
if choose is 1:
word=input("Enter the word\n")
if word in dictionary:
meaning=dictionary[word]
print(meaning)
else:
print("Word donot exist in dictionary")
if choose is 2:
word=input("Enter the word\n")
if word in dictionary:
print("Word already exists in dictionary")
print("Try replacing meaning by going in option 3")
else:
defination=input("Enter the defination")
dictionary[word]=defination
if choose is 3:
word=input("Enter the term\n")
if word in dictinary:
meaning=input("Enter the meaning\n")
dictionary[word]=meaning
else:
print("This term donot exist in dictionary")