Remove duplicate tuples from a list if they are exactly the same including order of items
问题 I know questions similar to this have been asked many, many times on Stack Overflow, but I need to remove duplicate tuples from a list, but not just if their elements match up, their elements have to be in the same order. In other words, (4,3,5) and (3,4,5) would both be present in the output, while if there were both (3,3,5) and (3,3,5) , only one would be in the output. Specifically, my code is: import itertools x = [1,1,1,2,2,2,3,3,3,4,4,5] y = [] for x in itertools.combinations(x,3): y