How to replace a string using a dictionary containing multiple values for a key in python
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have dictionary with Word and its closest related words. I want to replace the related words in the string with original word. Currently I am able replace words in the string which has only value per key ,I am not able to replace strings for a Key has multiple values. How can this be done Example Input North Indian Restaurant South India Hotel Mexican Restrant Italian Hotpot Cafe Bar Irish Pub Maggiee Baar Jacky Craft Beer Bristo 1889 Bristo 188 Bristo 188. How dictionary is made y= list(word) words = y similar = [[item[0] for item in