Question: Write a python program called anagram.py that does the following: Reads in words and their meanings from a text file called words.txt (this is on
Write a python program called anagram.py that does the following:
Reads in words and their meanings from a text file called words.txt (this is on Blackboard). The easiest way to store these would be in a dictionary. You may have a dictionary that looks like the one shown below:
{ fastidious:fussy, delighted:happy; pleased, ..}
Alternatively, you could store the words in a list and their meanings in a separate list (in a corresponding location, of course).
Your program should pick a word from the dictionary/list, jumble the letters, and ask the user to unscramble it. 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:
Unscramble the letters to form a word.
Type '?' for the meaning of the unscrambled word
atgprveeiro
Enter word [? for meaning of unscrambled word]: ?
The word means: privilege
atgprveeiro
Enter word [? for meaning of unscrambled word]: prerogative
You got it! Do you want to continue [yes or no]: yes
Unscramble the letters to form a word.
Type '?' for the meaning of the unscrambled word
ssiouadtfi
Enter word [? for meaning of unscrambled word]: fastidious
You got it! Do you want to continue [yes or no]: no
Link to words.txt : https://drive.google.com/open?id=1oUaaSbvHpU-tXG-rWeCGeYedKlJ_MN4v
Can you please provide the screenshot of the working program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
