Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python flatten one liner

#The list of lists
list_of_lists = [range(4), range(7)]

#flatten the lists
flattened_list = [y for x in list_of_lists for y in x]
Source by coderwall.com #
 
PREVIOUS NEXT
Tagged: #python #flatten #liner
ADD COMMENT
Topic
Name
2+9 =