题解 | #统计字符#
统计字符
http://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
in_str = str(input()) count_alp = 0 count_emp = 0 count_dig = 0 count_oth = 0 for i in in_str: if(i.isalpha()): count_alp += 1 if(i.isdigit()): count_dig += 1 if(i == " "): count_emp += 1 print(count_alp) print(count_emp) print(count_dig) print((len(in_str)-count_alp-count_emp-count_dig))