Hi all, I couldn't get pass this lesson, what's wrong with my code?
Here is the lesson:
I got this error:
Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "['hey', 'hey', 'hey']" when it should return "*** *** ***".
def censor(text, word): lst = text.split() for chk in lst: if chk == word: chk = '*' * len(word) return ' '.join(lst)