python中判断字符串是否为中文

判断字符串是否在中文编码范围内 

for c in s:
        if not ('\u4e00' <= c <= '\u9fa5'):
            return False
    return True

posted @ 2018-06-09 20:25  显示名称已经被使用  阅读(1948)  评论(0编辑  收藏  举报