What is wrong?


Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "*** " when it should return "*** *** ***".

def censor(text, word):
    for a in t:
        if a==word:
            return '*'*len(a)+" "
            return word


When you return something, then it exits the function itself. instead of returning the value, why don't you append it to an array, which you can then join and print out.

Barry Allen