May-20-2020, 02:52 PM
The example is a list of 2, with each element having 3. That said, you want to flatten the list to be 1 by 6.
mylist = [[1,2,3],[4,5,6]] flatlist = [item for sublist in mylist for item in sublist] print(flatlist)
Output:[1, 2, 3, 4, 5, 6]