Please help me check what's the problem with my code


#1

Hello,friends,please help me check what's the problem with my code, I think it's alright and more applicable,but it runs with mistake.

def censor(text,word):
textlist=list(text)
wordlist=list(word)
for i in textlist:
m=textlist.index(i)
if textlist[m:(m+len(wordlist))]==wordlist:
textlist[m:]=""len(wordlist)
print textlist
text_new="".join(textlist)
print text_new
return text_new


10. Censor
#2

(m+len(wordlist))
you know your wordlist len when added to later index of textlist is not upper than len textlist?
this is imposible.
next is

textlist[m:]=""len(wordlist)

"" is wrong