#计数.py(
Str=input('请输入一段字符亲:')
char=0
space=0
num=0
other=0
for i in Str :
if ((i>'A' and i<'Z')| (i>'a' and i<'z')): #查找字母
char=char+1 #字母个数累加(char+=1)
elif (i==' '): #查找空格
space=space+1
elif (i>'0' and i<'9'): #查找数字
num=num+1
else:
other=other+1 #查找其他
print('字母:%d'%char,'空格:%d'%space,'数字:%d'%num,'其他:%d'%other)