DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
flatten nested list
def flatten(x): if isinstance(x, list): return [a for i in x for a in flatten(i)] else: return [x]
PREVIOUS
NEXT
Tagged:
#flatten
#nested
#list
ADD COMMENT
Topic
COMMENT
Name
1+7 =
Submit