import re # 判断是否包含英文 str = "text文本" contain_en = bool(re.search(‘[a-z]‘, str)) if contain_en: print("包含英文字符") else: print("不包含英文字符")
python判断是否包含英文字符
原文:https://www.cnblogs.com/jumpkin1122/p/11516944.html