0
[[0, 0, 3, 50], [50, 100, 4, 20]]

I want to convert the above list to ,

[0, 0, 3, 50, 50, 100, 4, 20].

I tried using the split() but it doesn't work.

Daniel Walker
  • 6,380
  • 5
  • 22
  • 45
Mod_x
  • 21
  • 4
  • 1
    Does [this post](https://stackoverflow.com/questions/17485747/how-to-convert-a-nested-list-into-a-one-dimensional-list-in-python) answer your question? – tax evader May 07 '22 at 23:52

1 Answers1

1

Try the following:

list_2d = [[0, 0, 3, 50], [50, 100, 4, 20]]
list_1d = [i for nested in list_2d for i in nested]
print(list_1d)