在vscode 中,
list_x = [‘a’,‘b’,‘D’,‘s’,‘W’]
r = filter(lambda x: True if x > ‘a’ and x < ‘z’ else False, list_x)
print(list®)
运行结果即可出来小写的三个字母而把大写字母过滤掉了
python 中过滤大小写字母中的小写字母
最新推荐文章于 2024-03-21 15:01:54 发布
在vscode 中,
list_x = [‘a’,‘b’,‘D’,‘s’,‘W’]
r = filter(lambda x: True if x > ‘a’ and x < ‘z’ else False, list_x)
print(list®)
运行结果即可出来小写的三个字母而把大写字母过滤掉了