I am trying to find the count of words that occured in a file. I have a text file (TEST.txt) the content of the file is as follows:
TEST.txt
ashwin prog
f = open('input.txt', 'r') data=f.read().lower() list1=data.split() d={} for i in set(list1): d[i]=0 for i in list1: for j in d.keys(): if i==j: d[i]=d[i]+1 print(d)