hi, can someone tell me what's wrong with my code?
Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "******" when it should return " *** ***".
def censor(text, word): texts = text.split() result = '' for i in texts: if i == word: result= result + ('*'*len(i)) else: result= result + i ''.join(text) return result
I don't know how to add the space between the '*'