题解 | 统计字符
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
import sys
import string
all_s = string.ascii_letters
s = input()
d = {'s':0,'n':0,' ':0,'o':0}
for _ in s:
if _ in all_s:
d['s']+=1
elif _ in {'1','2','3','4','5','6','7','8','9','0'}:
d['n']+=1
elif _ == ' ':
d[' ']+=1
else:
d['o']+=1
print(d['s'])
print(d[' '])
print(d['n'])
print(d['o'])

