This is my current code which prints out the frequency of each character in the input file.
from collections import defaultdict
counters = defaultdict(int)
with open("input.txt") as content_file:
content = content_file.read()
for char in content:
counters[char] += 1
for letter in counters.keys():
print letter, (round(counters[letter]*100.00/1234,3))
I want it to print the frequency of bigrams of only the alphabets(aa,ab,ac ..zy,zz) and not the punctuation as well. How to do this?