Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

flatten a list

# flatten a list
flst = [[1,2,3], [8,9,12,17],[3,7]]
flatten_list = sorted(sum(flst,[]))
print(flatten_list)					# [1, 2, 3, 3, 7, 8, 9, 12, 17]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flatten #list
ADD COMMENT
Topic
Name
5+5 =