直接上代码: str = "[alsdjfkjas.,;'/{)&^%$#@!哈哈*(&^wdjkfjakl哇哇" count = 0 for s in str: if '\u4e00' <= s <= '\u9fff': count += 1 核心思想:在utf-8下,用编码范围锁定汉字,排除字符