How to Convert a List of Lists Into A Single List
Say, you want to convert a list of lists lst=[[1, 2], [3, 4]] into a single list [1, 2, 3, 4]. How to achieve this? There are different options: List comprehension [x for l in lst for x in l] assuming you have a list of lists lst. Unpacking [*lst[0], *lst[1]] assuming you have a … Read more