import re
f=open(‘Desktop/Walden.txt’,“r”)
txt=f.read()
f.close()
txt=txt.lower()
txt=re.sub(’[;,.?""!-]’,’’,txt)
words=txt.split()
word_sq = {}
for i in words:
if i not in word_sq.keys():
word_sq[i]=1
else:
word_sq[i] =1
res=sorted(word_sq.items(),key=lambda x:x[1],reverse=True)
print(res)