Open this example in the interactive library
Source code
nested = [[1, 2], [3], [4, 5]]
print([item for row in nested for item in row])Sample output
[1, 2, 3, 4, 5]

Flatten one level. A self-contained example using the Python standard library.
Open this example in the interactive library
nested = [[1, 2], [3], [4, 5]]
print([item for row in nested for item in row])[1, 2, 3, 4, 5]