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