题解 | #统计字符#
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
my_str = input() count_a = 0 count_s = 0 count_d = 0 count_o = 0 for i in my_str: if i.isalpha(): count_a += 1 elif i.isspace(): count_s += 1 elif i.isdigit(): count_d += 1 else: count_o +=1 print(count_a) print(count_s) print(count_d) print(count_o)