I am trying to create a list of sets of 3 items containing all combinations of the items from list where the first number in each set is not repeated.
For example: Set is A,B,C Results: ABC BCA CAB
I have tried using itertools import permutations, but this will give me all possible permutations including one's where the first (left hand) item repeats. For example: ABC ACB
I have used the below code:
from itertools import permutations
a = ["A123", "A456","A789"]
p = permutations(a)
for j in list(p):
print(j)