设置一个敏感词库填入合适的代码,使程序完整。

设置一个敏感词库,如果输入的字符串中包含有该列表中的敏感词则以号替换,并输出屏蔽敏感词后的字符串。例如输入:“哪里能买到盗版软件”,输出“哪里能买到软件”。

现规定敏感词库由以下词组成:垃圾,山寨,内幕,盗版。

填入合适的代码,使程序完整。

敏感词库={'垃圾','山寨','内幕','盗版'}

txt=input()

for word in ① :

if word in   ②  :

    txt=  ③  

print(txt)

敏感词库={'垃圾','山寨','内幕','盗版'}

txt=input()

for word in 敏感词库:

    if word in txt:
    
        txt=  txt.replace(word, '*'*len(word))
print(txt)



用星号替换:txt.replace(word,'*')

txt = input()
for word in ['垃圾','山寨','内幕','盗版']:
    if word in txt:
        txt = txt.replace(word,'*')
print(txt)

【有帮助请采纳】

txt = input()
for word in ['垃圾','山寨','内幕','盗版']:
    if word in txt:
        txt = txt.replace(word,'')
print(txt)

【有帮助请采纳】