Hi, I need some help revising my code for censor. Here is my code:
def censor(text, word):
words = text.split(" ")
censored = 
for item in words:
if item == word:
censored.append("*" * len(item))
The error message is: Your function fails on censor("hey hey hey","hey"). It returns "['', '', '']" when it should return " *** ***"
My guess was that it wants censored to be a string, but when I change it to a string it still does not work. In other words, my code works but returns brackets instead of quotations because it is a list and it will not work if I change it to a string.