import collections
f=open("D:\python\Walden.txt","r").read()
f=f.replace(',','').replace('.','').replace('"','').replace(':','')
f=f.split()
r=collections.Counter(f)
print(r)
import collections
f=open("D:\python\Walden.txt","r").read()
f=f.replace(',','').replace('.','').replace('"','').replace(':','')
f=f.split()
r=collections.Counter(f)
print(r)