What's wrong with this code?


#1

The function, for some reason, returns the exact same string as the the input for some reason. Anybody know why?

def censor(text, word):
    text = text.split()
    for x in text:
        if x == word:
            x = "*"*len(x)   
    return " ".join(text)

#2

You're changing x