What is wrong?


#1


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


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


#2

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.

Regards,
Barry Allen