1 parent b6561e7 commit d4aae7cCopy full SHA for d4aae7c
1 file changed
notes/filter_reduce.py
@@ -0,0 +1,6 @@
1
+from functools import reduce
2
+
3
+numbers = [5,1,7,4,2,6,3,8]
4
5
+print(list(filter(lambda x: x % 2 == 0, numbers)))
6
+print(reduce(lambda x, y: x * y, numbers))
0 commit comments