Python如何判断字符串中是否有中文
解决:Python如何判断字符串中是否有中文
1 In [240]: s
2 Out[240]: '你好aa'
3
4 In [241]: for i in s:
5 ...: if u'\u4e00' <= i <= u'\u9fff':
6 ...: print("yes")
7 ...: else:
8 ...: print("no")
1 yes
2 yes
3 no
4 no
posted @ 2019-04-16 13:08 东京的樱花在巴黎飘下 阅读(...) 评论(...) 编辑 收藏