Вы должны использовать collections.Counter
from collections import Counter
text = 'aaaaabbbbbccccc'
c = Counter(text)
print c
Он печатает:
Counter({'a': 5, 'c': 5, 'b': 5})
Ваша переменная text
должна быть:
import string
text = open('text.txt').read()
# Filter all characters that are not letters.
text = filter(lambda x: x in string.letters, text.lower())
Для получения нужного вам результата:
for letter, repetitions in c.iteritems():
print letter, repetitions
В моем примере он печатает:
a 5
c 5
b 5
Для получения дополнительной информации Счетчики doc
input::placeholder {
font-family: Arial;
}
input:-ms-input-placeholder { /* Internet Explorer 10-11 */
font-family: Arial;
}
input::-ms-input-placeholder { /* Microsoft Edge */
font-family: Arial;
}