file=open(‘tt.txt‘,‘r‘) news=file.read() myreplace=‘‘‘,()!`%&*‘‘‘ for i in myreplace: myreplace=myreplace.replace(i,‘ ‘) wordlist=news.lower().split() wordict={} wordset=set(wordlist) wordCutSet={‘i‘,‘we‘,‘the‘} wordset=wordset-wordCutSet for w in wordset: wordict[w]=wordlist.count(w) print(wordict) sortword=sorted(wordict.items(),key=lambda e:e[1],reverse=True) print(sortword)