So I'm working on Censor, and even though I've come up with a working solution, it keeps telling me that its not working.
Here is my code.
def censor(text, word): split_text = text.split() new_text =  for x in split_text: if x == word: new_text.append(len(x)*"*") else: new_text.append(x + " ") return " ".join(new_text)
But it keeps giving me an error message saying:
Oops, try again.
Your function fails on censor("Yo go fro yo go","go"). It returns
"Yo ** fro yo **" when it should return "Yo ** fro yo **".
I've tried some other text strings and words to censor and its always printed correctly. Any thoughts?