A string is an anagram of another if the second string is simply a scrambled version of the first. Write a python program to implement the following game:

a) Reads in a file that has words and their meanings in a text file. An example "words and their meanings" file is given in blackboard. Note that your program needs to ask the user for the words and their meanings file to use.

b) The words and their meanings text file is of the csv (comma separated values) format. Use either notepad++ or notepad to create your file in the same format as the mywords.txt file given to you in blackboard

c) Your program should then pick a word from the "words and their meanings" file, scramble the letters, and ask the user to unscramble it. Every run of your program should pick a word at random.

d) The user may type in the unscrambled word or may ask for the definition/meaning of the word by entering a question mark. The game continues until the user says "no" to the question: Do you want to continue?.

A sample run is shown below (user inputs are in red):

Give the name of the “words and their meanings” file: mywords.txt
Unscramble the following letters to form a word. Type “?” for the meaning of
the unscrambled word: ulecenop
Enter the answer [or ? for the meaning]: ?
The word means: great wealth
Enter the answer [or ? for the meaning]: rich
Wrong, try again
Enter the answer [or ? for the meaning]: opulence
You got it! Do you want to continue [yes or no]: yes
Unscramble the following letters to form a word. Type “?” for the meaning of
the unscrambled word: yrnuep
Enter the answer [or ? for the meaning]: injury
Wrong, try again
Enter the answer [or ? for the meaning]: ?
The word means: extremely poor
Enter the answer [or ? for the meaning]: penury
You got it! Do you want to continue [yes or no]: no
Goodbye!

Hint: a) The easiest way to store the "words and their meanings" file would be in a dictionary. You may have a dictionary that looks like the one shown below:

{ "opulence":great wealth, penury:extremely poor, ...}

b) Please create your own "words and their meanings" file to test your code. I will be using my own test file to test your homework submission. Do not hard code filenames in your program.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.