Censor


#1

whats wrong in this code ?

def censor(text,word):
    
    
    words=text.split(" ")
    result=()
    
    for i in words:
        
        if i == word:
            
            result.append(len(word) * '*')
        else:
            result.append(i)
            
    return " ".join(result)

print censor(raw_input("Your text:"),raw_input("Your censor word:"))

#2

Did you intend the result sequence to be a tuple? A tuple object has no method, append().


#3

thank you m8 ... fixed it
result []


#4

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