Censor


#1



https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/4?curriculum_id=4f89dab3d788890003000096


Why is my join function not working? This function works correctly except it is not returning as a string but a list still.


def censor(text, word):
    text2 = text.split(" ")
    censor_text = []
    
    for w in text2:
        if w == word:
            censor_text.append("*" * len(word))
        else:
            censor_text.append(w)
    
    print censor_text
    " ".join(censor_text)
    print censor_text
    return censor_text
    
censor("hey hey hey word", "hey").


#2

you use .join() to join the list into a string, but don't store the result of the join action somewhere (like a variable)


#3

oh god.... thanks!!!!!!


#4