What is the error in this code?


#1

def censor(text,word):
word2=[]
s=""
word2=text.split(" ")

for i in word2:
     if i==word:
         for t in i:
             s+="*"
         s+=" "
     else:
         s+=i

text=s 

return text

#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.