def censor(text, word):
text_list = text.split(" ")
text_out = 
for w in range(len(text_list)):
if text_list[w] == word:
text_out.insert(w, "*" * len(text_list[w]))
return " ".join(text_out)
I was hoping that this would "*" at the correct indexed word but can't see why my code isn't working. Can you help?
Replace this line with your code.