def get_number(char):
"""
判断字符串中,中文的个数
:param char: 字符串
:return:
"""
count = 0
for item in char:
if 0x4E00 <= ord(item) <= 0x9FA5:
count += 1
return count
print(get_number("sasad对双方都"))
def get_number(char):
"""
判断字符串中,中文的个数
:param char: 字符串
:return:
"""
count = 0
for item in char:
if 0x4E00 <= ord(item) <= 0x9FA5:
count += 1
return count
print(get_number("sasad对双方都"))