输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数
# -*- coding: utf-8 -*-
#输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数
str = input('请输入一行字符 \n').strip()
letters = 0
space = 0
digit = 0
other = 0
for i in str:
if i.isalpha():
letters += 1
elif i.isspace():
space += 1
elif i.isdigit():
digit += 1
else:
other += 1
print(letters,space,digit,other)