first try of wells-read

mail@pastecode.io avatar
unknown
python
a year ago
584 B
2
Indexable
Never
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