From 62fbd12690d963995a713e7f24a51b9eb14ea069 Mon Sep 17 00:00:00 2001 From: FitriRibbit <91612800+FitriRibbit@users.noreply.github.com> Date: Mon, 19 Sep 2022 08:03:28 -0700 Subject: [PATCH] Update word dictionary.py 1. Add replay game feature 2. Show just first sentence from meaning 3. made word from user --- word dictionary.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/word dictionary.py b/word dictionary.py index 2248a6b..f5b7086 100644 --- a/word dictionary.py +++ b/word dictionary.py @@ -1,10 +1,17 @@ from PyDictionary import PyDictionary -dictionary = PyDictionary() +def main(): + dictionary = PyDictionary() + input_word = input("Input word you wanna translate: ") #made user input for words + + print(dictionary.meaning(input_word[0])) #just show about first sentence + +#code for replay again +print("Welcome To Our Word Translate!!") while True: - word = input("Enter your word: ") - if word == "": - break - - print(dictionary.meaning(word)) + input_again = input('Wanna Translate ? (y/n) ') + if input_again == 'Y' or input_again == 'y': + main() + else: + break