题解 | #统计字符#
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
s = input() count1,count2,count3,count4 = 0,0,0,0 for i in s: if i.isalpha(): count1 += 1 elif i.isdigit(): count3 += 1 elif i == ' ': count2 += 1 else: count4 += 1 print(count1) print(count2) print(count3) print(count4)