[Solved] Search and replace vulgar words in a text by using a text file containing all the bad words


i found the solution , i maked the content of the txt file in a list with split method ,

def check_offline(text):
list_pro = open('full-list-bad.txt','r')

content = list_pro.read()
list_content = content.split('\n')
for word in list_content :
    if word in text :
        remplacement = "*" * len(word)
        text = text.replace(word ,remplacement)
        print word
        print remplacement
return text

print check_offline(“this is a adult world ” )

adult


this is a ***** world

solved Search and replace vulgar words in a text by using a text file containing all the bad words