Right now my code prints how many times every word is used in the txt file. I'm trying to get it to ONLY print the top 3 words used with capital letters within the txt file...
file=open("novel.txt","r+")
wordcount={}
for word in file.read().split():
if word not in wordcount:
wordcount[word] = 1
else:
wordcount[word] += 1
for a,b in wordcount.items():
print (b, a)