题解 | #统计字符#
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
import sys word = 0 num = 0 blank = 0 other = 0 a = input() for i in a: if i.isalpha() == True: word +=1 elif i == ' ': blank+=1 elif i.isnumeric() == True: num +=1 else: other +=1 print(word) print(blank) print(num) print(other)