Alter List to String In Censor


#1



The return a is a 'List' type, I want to alter it to a 'String'? Anybody helps? :wink:


def censor(text,word):
    a=str.split(text)
    c=''
    d=0
    for b in a:
        if word==b:
            for i in range(0,len(word)):
                c+='*'
            a[d]=c
            c=''
            d+=1
        else:
            d+=1
    return a


#2

use .join(), see the hint.


#3

It helps!!! Thank you very much friend. :slight_smile: