题解 | #统计字符#
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
alpha = 0 digit = 0 space = 0 other = 0 a = input() for i in a: if i.isalpha() == True: alpha += 1 elif i.isdigit() == True: digit += 1 elif i == ' ': space += 1 else: other += 1 print(alpha) print(space) print(digit) print(other)