题解 | #统计字符#
统计字符
http://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
while True: try: a = input() eng_sum = 0 space_sum = 0 digit_sum = 0 symbol_sum = 0 for x in a: if x.isalpha(): eng_sum += 1 elif x.isspace(): space_sum += 1 elif x.isdigit(): digit_sum += 1 else: symbol_sum += 1 print(eng_sum) print(space_sum) print(digit_sum) print(symbol_sum) except: break