flatten and space age exercise

This commit is contained in:
Xevion
2019-07-17 15:32:22 -05:00
parent cb0267e2b6
commit feb944b73b
8 changed files with 237 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
from functools import partial
flatten_base = lambda l : [l] if type(l) != list else sum(map(flatten_base, l), [])
flatten = lambda l : list(filter(lambda item : item is not None, flatten_base(l)))