📜  python 从列表中创建对 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:46.346000             🧑  作者: Mango

代码示例1
>>> for pair in itertools.combinations([1,2,3,4],2):
...    print pair
...
(1, 2)
(1, 3)
(1, 4)
(2, 3)
(2, 4)
(3, 4)