首页 > 编程语言 > 详细

python 判断字符串中是否只有中文字符

时间:2018-05-28 20:40:57      阅读:241      评论:0      收藏:0      [点我收藏+]


python 判断字符串中是否只有中文字符

学习了:https://segmentfault.com/q/1010000007898150

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

 

python 判断字符串中是否只有中文字符

原文:https://www.cnblogs.com/stono/p/9102073.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!