For some reason when I run my code, it shows this: Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "*** *** " when it should return " *** ***".
I feel like that's kind of weird because I did exactly what the pormpt wanted me to do.
Replace this line with your code. def censor(text, word): centext =  spl = text.split() for wo in spl: if wo == word: wo = "*" * len(wo) else: wo = wo centext.append(wo) final = " ".join(centext) return final