In my code below, it splits and joins fine, and when I add print statements it looks like it's iterating over the list fine, but for some reason my if: statement isn't replacing the word. I'm sure it's something simple, but I can't find the problem.
" Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "hey hey hey" when it should return "*** *** ***"."
def censor(text, word): phrase = text.split() cen_word = '*' * len(word) print phrase for i in phrase: if i == word: i = cen_word return " ".join(phrase) print censor('forget this blank blank nonsense its a pile of blank','blank')