You should use the itertools library. You want to generate all the unique permutations of each element in the force set. Some code may look like
from itertools import permutations, combinations, chain
Then
In [1]: s = ('A', 'B', 'C') In [2]: [j for i in powerset(s) for j in permutations(i)] Out[2]: [('A',), ('B',), ('C',), ('A', 'B'), ('B', 'A'), ('A', 'C'), ('C', 'A'), ('B', 'C'), ('C', 'B'), ('A', 'B', 'C'), ('A', 'C', 'B'), ('B', 'A', 'C'), ('B', 'C', 'A'), ('C', 'A', 'B'), ('C', 'B', 'A')]