yurikhan: (Default)
Yuri Khan ([personal profile] yurikhan) wrote in [personal profile] amarao 2023-03-01 04:38 pm (UTC)

In [6]: list(itertools.chain(*[[1, 2], [3, 4]]))
Out[6]: [1, 2, 3, 4]

In [7]: list(itertools.chain.from_iterable([[1, 2], [3, 4]]))
Out[7]: [1, 2, 3, 4]

ну или в лоб:

In [8]: [x for xs in [[1, 2], [3, 4]] for x in xs]
Out[8]: [1, 2, 3, 4]

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting