1

我有这个数组:

[160, 177], [162, 169], [163, 169], [166, 173], [166, 176], [166, 177], [169, 176], [169, 177]]

如何将其拆分为 2 个单独的数组,使其变为:

[160,162,163,166,166,166,169,169]

[177,169,169,173,176,177,176,177]

4

1 回答 1

2

这应该这样做

l = [[160, 177], [162, 169], [163, 169], [166, 173], [166, 176], [166, 177], [169, 176], [169, 177]]
l1, l2 = zip(*l)
于 2013-04-22T17:21:46.923 回答