Hello, I'm receiving an error message that tells me my censor code is not functioning properly, but it doesn't give me a clue as to why. Can you help identify the error? Thanks!
Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "" when it should return "*** *** ***".
def censor(text, word): words = text.split(" ") censored = "" for item in words: if item == word: censored.join("*" * len(item)) else: censored.join(word) return censored