from itertools import permutations,combinations a =list(combinations([1,2,3,4], 2)) for x in a: print(x)