If I have this list1=[['A','B','C'], ['D','E'], ['F','G','H']]
Is there an easy way to have this output:
output:
list2=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
If I have this list1=[['A','B','C'], ['D','E'], ['F','G','H']]
Is there an easy way to have this output:
output:
list2=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
You can find several approaches for that here: How to make a flat list out of list of lists?
"Flatten a list" is the keyword for it ;-) Unfortunately it can be a bit tricky, but not too difficult!