I'm trying to count all the letters from a text but I want to exclude the counting of a letter next to a space
from collections import Counter
text = 'in the seas and let fowl multiply in the earth \nand the evening and the mo were the fifth day \nand gd slet the earth bring forth the livngke man in our image after our likeness and let d over all the'
txt = [x for x in text if x not in '\n'] #this what i did for excluding the newline
cc = Counter(zip(text, text[1:])).items()
print(cc)
I want to remove all the pair with space - like this (('n', ' '), 4)
From this
dict_items([(('i', 'n'), 5), (('n', ' '), 4), ((' ', 't'), 8), (('t', 'h'), 12), (('h', 'e'), 8), (('e', ' '), 10), ((' ', 's'), 2), (('s', 'e'), 1), (('e', 'a'), 3), (('a', 's'), 1), (('s', ' '), 2), ((' ', 'a'), 5), (('a', 'n'), 6), (('n', 'd'), 5), (('d', ' '), 7), ((' ', 'l'), 4), (('l', 'e'), 3), .....)
to this
dict_items([(('i', 'n'), 5), (('t', 'h'), 12), (('h', 'e'), 8), (('s', 'e'), 1), (('e', 'a'), 3), (('a', 's'), 1), (('a', 'n'), 6), (('n', 'd'), 5), (('l', 'e'), 3), .....)