Censor(Solved)


#1

So, I am not sure why this isn't a valid solution. It actually works It just doesn't pass.

 def censor(text, word):
    new_word = "*" * len(word)
    text = text.replace(word, new_word)
    print(text)

censor("hey hey hey", "hey")


#2

Solution was simple.

def censor(text, word):
    new_word = "*" * len(word)
    text = text.replace(word, new_word)
    return text