Hello, i have to write a piece of code that allows me to open a txt file which then tells me the amount of each letter there is in the document. However i have this code which opens the document but instead of telling me how manu letters it lists the amount of sentences e.g. it lists (Create a lazy list of prime numbers):1 instead of the amount of each letter there is.
Any help would be hughley appreciated.
import sys
textfile =(sys.argv)
a={}
openfile = open('Assignement list.txt')
for c in openfile:
try:
a[c]+=1
except:
a[c]=1
print a