Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "hey" when it should return "*** *** ***".
I think I am close since I have one of the letters as an asterisk but I don't know how to get all of the letters to have asterisks. Also, do I need to append this to another string?
def censor(text,word): j = len(word) i = text k = "" if i.index(word, 0, len(i)) != -1: for l in word: print i.replace(l, "*") * j return word return i print censor("hey hey hey", "hey")