1. 程式人生 > >python中判斷字符串是否為中文

python中判斷字符串是否為中文

urn pytho not als nbsp turn 判斷 字符串 判斷字符串

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

python中判斷字符串是否為中文