letter = 0
space = 0
num = 0
other = 0
str0 = input('请输入一段字符串:')
for i in str0:
if i.isalpha():
letter += 1
elif i.isspace():
space += 1
elif i.isdigit():
num += 1
else:
other += 1
print('字母个数为:', letter)
print('空格个数为:', space)
print('数字个数为:', num)
print('其他字符个数为:', other)