What will be the output of the Python Program to flatten a nested list without using recursion

a=[[5,[[4]],[[[2]]]],[[3],1]]
flatten=lambda l: sum(map(flatten,l),[]) if isinstance(l,list) else [l]
print(flatten(a))
Author: KaivalyaG | Tags: recursion | 1528 + Python FAQs | Report This Q. | Share This Q.
python | matrix | mutable | odd numbers | dictionary | debugging | strings | counter function | conditional statement | while and for loops | encapsulation | multiprocessing | modules | virtual environment | constructors | loops | zip function | goto function | features | docstring | generators in python | inits | installations | indexing | counter | computes | polymorphism | comprehension | matplotlib | precedence and associativity | parameters | exception | expression | encoding | variable | range | zfill function | lists | module | variables | thread | condition | pseudocode | tuples | control statements | gil | oops | iterator | libraries | escape operators | namespace | numpy | pickling & unpickling | asyncio module | pandas | recursion | magic methods | conversion | deep copy | regular expression | arithmetic expression | bitwise | fabs function | destructor | heap memory | decorators | sets | mysql | logical operations | multithreading | indentation | exception handling | lambda | string | class | shallow copy | random function | operators | sys | __future__ | arithmetic operations | pep | format | operator | random | recurssion | turtle | numeric | error | set | assert | list | generator | complex | classes and objects | decorator | files | head and tail | data type | keywords | matrix list comprehension | int | print | python modules | logical operators | math | tuple | __init_subclass__ | boolean | methods | functions | built-in functions | file handling | list comprehension | classes | swapping | slice | array | inheritance | return statement | for | syntax | operands | statements | datatypes | enumerate() | datetime | identifier | precedence | mapping functions | sum()