10 Why the censor is this not working?


def censor(text,word):
ntext = text.split()
for y in ntext:
if y == word:
ntext.replace(y, ""len(word))
" ".join(ntext)
return ntext
"'list' object has no attribute 'replace'" error. Check the Hint if you need help!
I saw people solving that with app.end but how do you solve this with replace command?? Thanks


Strings have a method called replace
But lists do not. That's what that error is telling you.


It worked for me in the next way

def censor(text,word):
.... word1="*"*len(word)
.... return text.replace(word,word1)


That was motherfocking genius man - thanks!