题解 | #统计字符#
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
#输入字符串
str1=[x for x in input()]
letter,blank,digit,others=0,0,0,0
for x in str1:
if x.isalpha():#检测字符是否是字母
letter+=1
elif x.isspace():#检测字符是否是空格
blank+=1
elif x.isdigit():#检测字符是否是数字
digit+=1
else:
others+=1
print(letter)
print(blank)
print(digit)
print(others)

