I'm not sure exactly why my code isn't working, I have a feeling that it is something simple. but i keep getting this error message: "Oops, try again. Your function fails on censor("hey hey hey","hey"). It returns "None" when it should return "*** *** ***"."
This is my code..
def censor(text,word): z=len(text) z='*'*z t=text.split(" ") w=str(word) k= for i in t: if i in w: i=i.replace(i,z) else: k=' '.join(k) print censor('how are you', 'are')