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 "sequence item 0: expected string, builtin_function_or_method found" error.
I'm trying to replace the "i"th element of "lis" by the number of asterisks as the length of word/low. When trying to put them back, it throws this error. What is going wrong?
def censor(text, word): low = word.lower lis = text.split() a = len(word) for i in range(0, len(lis)): lis[i] = lis[i].lower if (lis[i] == low): lis[i] = "*" * a new_str = " ".join(lis) return new_str print censor("this wack is hacking wack", "wack")