I feel like an idiot that I've spent 3 days on this off and on, but I can't figure this out. This is the function I've created to censor a word. Below are the error messages I get.
Traceback (most recent call last):
File "python", line 21, in
File "python", line 16, in censor
I can't seem to find any pages on these errors when I google them, which was a bit suspicious. Can anyone take a look at this and see where I'm goofing? Thanks.
def censor(text,word): lst_phrase =  lst_phrase = text.split() space = " " censorit = word for item in lst_phrase: if item == censorit: item = ('*' * len(item)) lst_phrase.append(item) else: lst_phrase.append(item) return space.join(lst_phrase) return word