因为汉字会被认为是Unicode编码的字母,所以isalnum返回也会是True。如果你想避免这个情况只要encode到utf-8就正常了
s = "你好" s.encode('utf-8').isalnum()
如有帮助望采纳,感谢