Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Flatten List in Python Using List Comprehension

List = [[0,1,2], [3,4,5]]
comp_list = [item for sublist in List for item in sublist]
print(comp_list)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Flatten #List #Python #Using #List #Comprehension
ADD COMMENT
Topic
Name
1+1 =