Nope,Actually you're thinking that
word refers to censored word,right ?
but it is not..
when you use it in for loop as iteration variable..
for word in text:
It no longer have value of censored word but now it gets single letter from text and iterates over and replaces the character of text.
one more thing...as you will think that
('*')*(len(word)) will have same number of * as your censored word then its also not the case.
as now your word (iteration variable) dynamically changes (because its an iteration variable) and it takes one character so it replaces one
* each time..
it does same thing with every
text and thus every letters of text is being replaced by *'s.