I have a list of bad words and another list of sentences. I want to list all the sentences that have at least one bad word in newlines
list then I want to delete it so I have pure sentences and I try like this but not work
f = open("demofile.txt")
read1= f.readlines()
g = open("abuse dic.txt")
read2 = g.readlines()
newlines = []
for line in f:
if any(s in line for s in read2):
newlines.append(line)
print(newlines)
g.close()
f.close()