Hey, my function returns the text just as he was. I can't figure out where the problem lies.
I thought, that through if word==x: x= ""len(word) the string would be replaced, but somehow it doesn't. I'd be grateful for help!
def censor(text,word): text=text.split() for x in text: if word==x: x= "*"*len(word) d=" " text= d.join(text) return text print censor("fu fu fo", "fo")