python判断字符串是否有中文符号?
def is_chinese(s): count = 0 for i in s: if (i >= u'\u4e00') and (i <=u'\u9fa5'): return True break else: count += 1 if count == len(s): return False 然后检查有没有中文就输is_chinese('内容'),记住括号里的字符串要加引号
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有