Make sure you import string module, with it you can get character ranges a to z
and A to Z
easily
import string
A Counter(any_string)
gives the count of each character in the string. By using split()
the counter would return the counts of each word in the string, contradicting with your requirement. So I have assumed that you need character counts.
dic_all_chars = dict(Counter(fh1)) # this gives counts of all characters in the string
signs = string.lowercase + string.uppercase + ' .,' # these are the characters you want to check
# using dict comprehension and checking if the key is in the characters you want
dic_freq_signs = {key: value for key, value in dic_all_chars.items()
if key in signs}
dic_freq_signs
would only have the signs that you want to count as keys and their counts as values.