问题:python如何判断字符串是否包含汉字?
方法:
def is_Chinese(word):
for ch in word:
if '\u4e00' <= ch <= '\u9fff':
return True
return False
print(is_Chinese("测试"))
参考:
https://blog.csdn.net/qq_32502511/article/details/82910465
问题:python如何判断字符串是否包含汉字?
方法:
def is_Chinese(word):
for ch in word:
if '\u4e00' <= ch <= '\u9fff':
return True
return False
print(is_Chinese("测试"))
参考:
https://blog.csdn.net/qq_32502511/article/details/82910465