>>> import itertools
>>> n = [1,2,3,4]
>>> combObj = itertools.combinations(n,3)
>>>
>>> combObj
<itertools.combinations object at 0x00000000028C91D8>
>>>
>>> list(combObj)
[(1, 2, 3), (1, 2, 4), (1, 3, 4), (2, 3, 4)]
>>>
>>> for i in list(combObj): #This prints nothing
... print(i)
...
我如何遍历 combObj ?
我怎样才能转换
[(1, 2, 3), (1, 2, 4), (1, 3, 4), (2, 3, 4)]
为
[[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]