Censor,whats wrong here


#1


Censor

def censor(word,text):
    a=len(word)
    for word in text:
        text.replace(word,"*"*a)
    return text


Replace this line with your code.


#2

replace() just does all the work for you, you don't learn to build your own function, are you sure you want this?

i find it confusing, word contains the sentence and text contains the word you want to censor. maybe swap your function parameters

you do a replace action, but you don't store the result of this replace anywhere


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.