> def censor(text,word): > if word in text: > word_stars = "" > word_stars = len(word) * "*" > > text.replace(word, word_stars) > print text > > > censor("this hack is wack hack", "hack")
I tried the above code, but i get the following error message
Oops, try again. Your function fails on censor(“hey hey hey”,“hey”). It returns “None” when it should return “*** *** ***”.
Any help would be appreciated, thank you in advance.