Answer:
#section 1
import re
thesaurus = {
"happy" : "glad",
"sad" : "bleak",
}
text =input('Enter text: ').lower()
#section 2
def synomReplace(thesaurus, text):
<em> # Create a regular expression from the dictionary keys
</em>
regex = re.compile("(%s)" % "|".join(map(re.escape, thesaurus.keys())))
# For each match, look-up corresponding value in dictionary
return regex.sub(lambda x: thesaurus[x.string[x.start():x.end()]].upper(), text)
print(synomReplace(thesaurus, text))
Explanation:
#section 1
In this section, the regular expression module is imported to carry out special string operations. The thesaurus is initialized as a dictionary. The program then prompts the user to enter a text.
#section 2
In the section, we create a regular expression that will search for all the keys and another one that will substitute the keys with their value and also convert the values to uppercase using the .upper() method.
I have attached a picture for you to see the result of the code.
Yes it is. Depending on your operating system there are many ways to uninstall a program. On Windows you go to Add or Remove Programs in the control panel which shows all of your uninstalled programs, you select the program you want to uninstall and click the “uninstall button”. I am not sure how it is on Mac or Linux though. On iOS you can hold down an app icon for a few seconds and press the “X” on the app icon to uninstall, you you can uninstall it from the settings app too. On Android it can be uninstalled from the settings app.
Fru, thats the only guy I watch, so ya.
Answer:
b. instantiated.
Explanation:
In computer programming, to be instatiated or when variables are instatiated; this simply refers to the acts of making example out of a group variables or a form of template. For example in a situation of class of objects.
Hence, in this case, the correct answer to the question above is the option B, in which Variables set equal to patterns are said to be INSTATIATED
Hi there!
Try resetting your browser, clearing your cache, and rebooting your computer.. If none of these work, or you've already tried these, let me know..
Hope this helps! ☺♥