摘要: 1、map 映射 l = [1, 2, 3, 4, 5] res = map(lambda x:x**2, l) print(list(res)) >>>[1, 4, 9, 16, 25] 注: 此时的res必须使用list(res) 否则只会返回一个对象 2、filter 过滤 l = [1, 2 阅读全文
posted @ 2023-10-13 15:56 wellplayed 阅读(7) 评论(0) 推荐(0) 编辑