特牛网址导航

Python---filter_表达式list(fitter(lambda x.isupper(), [‘a’,’b’,’ab’])-CSDN博客

网友收藏
文章浏览阅读366次。filter在Python中也是一个类,,可以过滤一些不符合我们定义规则的元素 将list_x列表中的0都过滤掉list_x = [1, 0, 1, 2, 0, 1]f = filter(lambda x: x, list_x)print(list(f))------------------------------------------输出:[1, 1, 2, 1]l..._表达式list(fitter(lambda x.isupper(), [‘a’,’b’,’ab’]))的值为