I don't like this method, but this is quite difficult for me to explain it easy, so here you have my code
tex = text.split()
for t in tex:
return " ".join(new_text)
First of all you need to create new empty list, into which you will insert (append) words.
So this part
doesn't do anything. If
i == word you append as many * as word is long to your empty list.
You also need
else statement, because in your current code nothing happens with words which are different than check word. If they are different you just append them to new list.