Censor


#1


censor

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

I wonder how to solve this exercise..!! please help


def censor(text,word):
    b = len(word)
    c = " "
    c = text.split(" ")
    # d = []
    d = " "
    s = " "
    for item in c:
        if item == word:
            d += "*" * b + " "
          #   d.append("*"*b)
        else:
            d += item  + " "
          #  d.append(item)
   
    s= d.strip()
    print s
    
    
censor ("hey hey hey", "hey").


#2

you should return the reversed string, you currently print the reversed string


#3

thanks..

I passed censor.


#4