使用过滤器filter筛出所有的小写字母:
X.istitle() #判断X中是否有小写的字母
list_x=['aaaaa','Aa','bddB','Bbaaa','cD','Bd','A']
r=filter(lambda x:x if x.istitle() else False,list_x)
print(list(r))
tips:结合上一篇可以过滤/判断出是否带有小写/大写字母或数字或首字母大写的值
上一篇:python3判断字符串是字母/数字/大小写的系统函数
使用过滤器filter筛出所有的小写字母:
X.istitle() #判断X中是否有小写的字母
list_x=['aaaaa','Aa','bddB','Bbaaa','cD','Bd','A']
r=filter(lambda x:x if x.istitle() else False,list_x)
print(list(r))
tips:结合上一篇可以过滤/判断出是否带有小写/大写字母或数字或首字母大写的值
上一篇:python3判断字符串是字母/数字/大小写的系统函数