So this is my code:
cnsr = "*" * len(w)
t_list = t.split()
for word in t_list:
index = int(t_list.index(w))
if word == w:
return " ".join(t_list)
print censor('dog cat dog','cat')
but whenever I hit 'Save and Submit' I get this:
Traceback (most recent call last):
File "python", line 11, in
File "python", line 5, in censor
ValueError: 'cat' is not in list
I don't understand why it's saying 'cat'
isn't in the list. if I print the t_list then I get a list containing 'cat'. I'm really lost.
(I have no idea why it doesn't show any indentation on here but I'm pretty sure that's not where the problem is)