A generic trademark is what you get when a brand becomes so famous that people mistake it for the generic product.
One of the most famous examples is Velcro. The generic name is actually "hook and loop fastener". Much less catchy.
Write a program that can get rid of the brand names and replace them with the generic names.
The table below shows some brand names that have generic names. The mapping has also been provided to you in your program as the BRANDS dictionary.
BRANDS = {
'Velcro': 'hook and loop fastener',
'Kleenex': 'tissues',
'Hoover': 'vacuum',
'Bandaid': 'sticking plaster',
'Thermos': 'vacuum flask',
'Dumpster': 'garbage bin',
'Rollerblade': 'inline skate',
'Asprin': 'acetylsalicylic acid'
}
For this problem, you need to read in a sentence, and replace all brand names with the generic names like this:
Sentence: I bought some Velcro shoes. I bought some hook and loop fastener shoes.
Sentence: Time to Hoover the house. Time to vacuum the house.
It should remove all brands.
Sentence: Buy some Aspirin and Kleenex. Buy some acetylsalicylic acid and tissues.
I have tried this as my solution:
BRANDS = {
'Velcro': 'hook and loop fastener',
'Kleenex': 'tissues',
'Hoover': 'vacuum',
'Bandaid': 'sticking plaster',
'Thermos': 'vacuum flask',
'Dumpster': 'garbage bin',
'Rollerblade': 'inline skate',
'Asprin': 'acetylsalicylic acid'
}
sentence = input('Sentence: ')
for brand in BRANDS:
sentence.replace(brand, BRANDS[brand])
print(sentence)