"Oops, try again. Does your censor function take exactly two arguments, a text string and a word to replace with asterisks? Your code threw a "list indices must be integers, not str" error."
Not entirely sure what i've done wrong, thought it would censor a word in text that == the variable word, but throws me an error instead.
def censor(text, word): text2 = text.split(" ") for words in text2: if text2[words] == word: text2[words] = "*" * len(word) return "".join(text2)