Question: Create a program using Python that provides a simple, personal translation dictionary. Provide a text-driven menu that permits: translating a word adding a word to

Create a program using Python that provides a simple, personal translation dictionary. Provide a text-driven menu that permits:

translating a word

adding a word to the dictionary

printing the current dictionary

exiting

Use functions where appropriate, do not forget docstrings. Ensure your menu system handles input errors. You can structure your dictionary how you like, but it may be best to have a dictionary of dictionaries where the keys at the top level are English words and the values are dictionaries with keys being the foreign language and values being the translation. For example:

langDict = {"hello":{"Spanish":"hola","French":"bonjour"}, "good-bye":{"Spanish":"adios"}}

IMPORTANT!!!! - Make sure to read your dictionary in from a file upon program start-up and write your dictionary out to the same file at program termination.

Possible Outcome Example:

Create a program using Python that provides a simple, personal translation dictionary.

Main Menu 1-translate a word 2-add word to dict -print current translation dictionary -exit Please make a selection: Invalidinput Main Menu 1-translate a word 2-add word to dict -print current cranslation dictionary -exit Please make a selection: joe Invalid Input- integer only Main Menu -teanslate a word 2-add word to dict -print current cranslation dictionary -exit Please make a selection: Provide an English word: SoEEy no translation for that word Main Nenu -translate a word 2-add word to dict -print current translation dictionary -exit Please make a selection: Provide an English word: hello -'Spanish hola''French'bonjour Main Menu 1-translate a word -add word to dict 3-print current teanslation dictionary -exit Please make a selection:2 What Eng word are you providing a translation for: What language is the translated word in: Spanish What is the translated word:i Main Nenu -teanslate a word add word to dict -print current translation dictionary -exit Please make a selection: What Eng word are you providing a translation fors yes The word already exists yes- 'Spanish' What language is the translated word in: French What is the translated word: ou Main Nenu -teanslate a word 2-add word to dict -print current translation dictionary -exit Please make a selection: hello Spanish' hola' French' bonjour good-bye-Spanish': adios es-Spanish' French' ou' Main Menu 1-translate a word -add word to diet -print current translation dictionary -exit Please make a selection: Goodbye Main Menu 1-translate a word 2-add word to dict -print current translation dictionary -exit Please make a selection: Invalidinput Main Menu 1-translate a word 2-add word to dict -print current cranslation dictionary -exit Please make a selection: joe Invalid Input- integer only Main Menu -teanslate a word 2-add word to dict -print current cranslation dictionary -exit Please make a selection: Provide an English word: SoEEy no translation for that word Main Nenu -translate a word 2-add word to dict -print current translation dictionary -exit Please make a selection: Provide an English word: hello -'Spanish hola''French'bonjour Main Menu 1-translate a word -add word to dict 3-print current teanslation dictionary -exit Please make a selection:2 What Eng word are you providing a translation for: What language is the translated word in: Spanish What is the translated word:i Main Nenu -teanslate a word add word to dict -print current translation dictionary -exit Please make a selection: What Eng word are you providing a translation fors yes The word already exists yes- 'Spanish' What language is the translated word in: French What is the translated word: ou Main Nenu -teanslate a word 2-add word to dict -print current translation dictionary -exit Please make a selection: hello Spanish' hola' French' bonjour good-bye-Spanish': adios es-Spanish' French' ou' Main Menu 1-translate a word -add word to diet -print current translation dictionary -exit Please make a selection: Goodbye

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!