<In what way does your code behave incorrectly? Include ALL error messages.>
Your function fails on censor(“hey hey hey”,“hey”). It returns “hey hey hey” when it should return " *".
<What do you expect to happen instead?>
I expect to reach the desired solution, replacing whatever string word is in text with *s.
I am sort of totally lost with this lesson for some reason. I feel like I’m over thinking it though. I turn word into a list and replace each item in the list with *, and then use join. But when I try to iterate through “text” for the word to replace with the variable “word_list” it simply doesn’t work. What am I doing wrong? I don’t want the answer, just a nudge in the right direction, or an explanation of the logic I should be using.
def censor(text, word): word_list =  for i in word: word_list.append(i) for i in range(len(word_list)): word_list[i] = "*" word_list = "".join(word_list) text.split(",") for i in range(len(text)): if text[i] == word: word = word_list return text print censor("I am here", "here" )