Can someone explain what is going on? The word does not get censored at all. I think the problem is in line 5
words = '*' * len(words). It seems to not be replacing the chosen word in the list with the asterisks.
def censor(text, word): text = text.split() for words in text: if words == word: words = '*' * len(words) text1 = " ".join(text) return text1 print censor("bjd aeivdn efsd ws", "bjd")