I'm using Python3 on windows. How do I include multiple text files so that I can run my code using more than one file?
article_one = re.findall('\w+', open('D.txt',).read().lower())
wordbank = {}
for word in article_one:
word = word.lower().strip(string.punctuation)
if word not in wordbank:
wordbank[word] = 1
else:
wordbank[word] += 1
sortedwords = sorted(wordbank.items(), key=operator.itemgetter(1))
for word in sortedwords:
print (word[1], word[0])