#统计输入一行字符串中不同字符的个数
str1 = input("请输入一行字符:")
num_alpha = num_numeric = num_space = num_other = 0
for i in str1:
if i.isalpha():
num_alpha += 1
elif i.isnumeric():
num_numeric += 1
elif i.isspace():
num_space += 1
else:
num_other += 1
print("字母={}个,数字={}个,空格={}个,其他字符={}个".format(num_alpha,num_numeric,num_space,num_other))