Как использовать пользовательские шрифты для заполнителя ввода?

Вы должны использовать 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

1
задан Artur Haddad 6 March 2019 в 00:34
поделиться

1 ответ

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;
}
0
ответ дан Dante Martins 6 March 2019 в 00:34
поделиться