first try of wells-read

 avatar
unknown
python
3 years ago
584 B
6
Indexable
import string

dic = {}

fp = open("words.txt","r")
for line in fp:
    line = line.strip().split(" ")
    for word in line:
        dic[word] = 1

fp.close()

fp = open("time.txt","r")
fout = open("output.txt","w")

for line in fp:
    line = line.strip().translate(str.maketrans('','',string.punctuation)).split(" ")
    if line[0]=='':
        pass
    else:
        for word in line:
            if(word not in dic and word.lower() not in dic):
                fout.write(word)
                fout.write("\n")
            else:
                pass


Editor is loading...