subject

Using python

you have been hired by a small software company to create a "thesaurus" program that replaces words with their synonyms. the company has set you up with a sample thesaurus stored in a python dictionary object. here's the code that represents the thesaurus:

# define our simple thesaurus
thesaurus = {
"happy": "glad",
"sad" : "bleak"
}
the dictionary contains two keys - "happy" and "sad". each of these keys holds a single synonym for that key.

write a program that asks the user for a phrase. then compare the words in that phrase to the keys in the thesaurus. if the key can be found you should replace the original word with a random synonym for that word. words that are changed in this way should be printed in uppercase letters. make sure to remove all punctuation from your initial phrase so that you can find all possible matches. here's a sample running of your program:

enter a phrase: happy birthday! exclaimed the sad, sad kitten
glad birthday exclaimed the bleak bleak kitten

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
When is it most apprpriate for a development team to change the definition of done
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
What are some websites that you can read manga (ex: manga rock)
Answers: 1
You know the right answer?
Using python

you have been hired by a small software company to create a "thesaurus" pro...
Questions
question
History, 02.08.2019 15:00
question
History, 02.08.2019 15:00
Questions on the website: 13722361