📅  最后修改于: 2022-03-11 14:45:49.151000             🧑  作者: Mango
# itertools — Functions creating iterators for efficient looping
# See : https://docs.python.org/3/library/itertools.html
import itertools
x = [A,1,B,2]
l = list(itertools.combinations(x, 2))
print(l)
[(A, 1), (A, B), (A, 2), (1, B), (1, 2), (B, 2)]