"Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "None" when it should return "*** *** ***"."
I wrote code that fulfills the need of the lesson, but the lesson insists my function fails for "hey hey hey." When I test that variable, my code correctly replaces it with "*** *** ***." I am very new to Python, so please thoroughly explain where am I going wrong? Since I am new, I welcome all advice to become a better programmer.
text=raw_input('Enter phrase: ') word=raw_input('Find and replace which word with an asterisks?') def censor(text, word): text_separated=text.split() for count, x in enumerate(text_separated): if x==word: text_separated[count]='*'*len(x) print " ".join(text_separated) print censor(text, word)