I know the hint suggests splitting the string into a list to cycle through each word individually. I've been trying to solve it without splitting anyway, but with no success. Apparently my code does absolutely nothing, since I get the following error message:
"Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "hey hey hey" when it should return "*** *** ***"."
Any tips, or should I just try splitting the string?
def censor(text,word): if word in text: text.replace(word, "*"*(len(word))) return text