Chinaunix's Archiver
论坛
›
Python
› 判断字母
shreychen
发表于 2014-11-19 09:56
>>> s = 'adfeife df吓到 erqapfdanfeiurepoefu832k'
>>> count = [(i,s.count(i)) for i in set(s) if i.isalpha()]
>>> for i,n in count:
... print i,n
...
a 3
e 6
d 3
f 6
i 2
k 1
p 2
n 1
r 2
u 2
q 1
o 1
页:
1
[2]
查看完整版本:
判断字母