Python题解 | #统计字符#
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
import sys
s = input()
a, b, c, d = [0, 0, 0, 0]
for i in s:
if i.isalpha():
a += 1
elif i == ' ':
b += 1
elif i.isdigit():
c += 1
else:
d += 1
print(a)
print(b)
print(c)
print(d)

