I'm working on the Censor exercise: https://gist.github.com/e575de572a0f368b0cd2e85fbcaaa923
I've looked at a few people's code and seen different ways to do this. I'm trying to accomplish it with as little code as possible and as simply as possible. My issue is that even though I'm splitting "text" and appending it to the "phrase" list, Python is looking for the entire "phrase" list to match "word" in my "for" loop in order to censor it. I've tried moving the split around but am not having any luck. I feel like my mistake is in my implementation of the split, but I'm not sure what it is. Any suggestions?
def censor(text, word): text = text.split() phrase =  phrase.append(text) for each in phrase: if each == word: return "*" * len(word) else: return each return " ".join(phrase) print censor("Hey there friend", "friend")