有点懒,直接用string模块的字符集去处理判断拉倒,无脑干 from string import ascii_letters, digits, punctuation, whitespace while True: try: l_count, d_count, p_count, w_count = 0, 0, 0, 0 for x in input(): if x in ascii_letters: l_count += 1 elif x in digits: ...