TelenkovDmitry 2 月之前
父节点
当前提交
56ef0539fe
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15 0
      courses/python_func/filter.py

+ 15 - 0
courses/python_func/filter.py

@@ -0,0 +1,15 @@
+
+
+def test_1():
+    a = ['departure', 'execute', 'service', 'extreme', 'suppress']
+    print(list(filter(lambda x: x[0] == x[-1], a)))
+
+
+def main():
+    pass
+
+
+if __name__ == '__main__':
+    # main()
+    a = [1, 2, 3, 4, 5]
+    print(list(filter(None, a)))