标签: python list tuples
我有一个包含元组的列表列表:
[[(1L,)], [(2L,)], [(3L,)], [(4L,)], [(5L,)]
如何编辑列表,使列表如下所示:
l = [[1][2][3][4][5]]
答案 0 :(得分:6)
>>> a [[(1L,)], [(2L,)], [(3L,)], [(4L,)], [(5L,)]] >>> a = [[x[0][0]] for x in a] >>> a [[1L], [2L], [3L], [4L], [5L]]