Upload
profbnk
View
153
Download
3
Embed Size (px)
Citation preview
def censor(text, word):
list1 = text.split()
newlist = []
final_list = []
for w in list1:
if w == word:
newlist.append("*" * len(word))
else:
newlist.append(w)
final_list = " ".join(newlist)
return final_list