函数式编程filter和map的区别
# b = filter(lambda x:x>5,[1,2,3,4,5,6,7]) # print(list(b)) def filters(x): if x > 5: return x b = filter(filters,[1,2,3,4,5,6,7]) print(list(b))#[6, 7] def maps(x): if x > 5: return x b = map(maps,[1,2,3,4,5,6,7]) print(list(b))#[None, None, None, None, None, 6, 7]