Here's my code:
def censor(text, word):
text = text word = word textLength = len(text) lenWord = len(word) for i in range(textLength): # for each letter in the text if text[i] == word: # if the letter = first letter in word for j in range(lenWord): # for the length of the word if text[i + j] != word[j]: #if the letters match up break else: for k in range(lenWord): text[i + k] = "*" return text
I'm getting the error message: "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 "'str' object does not support item assignment" error." and I don't know why. Can someone help?