方法1-常规 s = input() # 初始化计数器 alpha, space, digit, other = 0, 0, 0, 0 # 遍历字符串,统计各类字符的个数 for char in s: if char.isalpha(): alpha += 1 elif char.isspace(): space += 1 elif char.isdigit(): digit += 1 else: other += 1 print(alpha) print(space) print(digit...