Task: Write a function called censor that takes two strings, text and word, as input. It should return the text with the word you chose replaced with asterisks.
Error: Your function fails on censor("hey hey hey","hey"). It returns "['hey', 'hey', 'hey']" when it should return "*** *** ***".
def censor(text, word): split = text.split(" ") return split for i in split: if i == word: i = "*" * len(word) return i return " ".join(split)
Any suggestions are greatly appreciated!