l = [['a', 'b'], ['c', 'd'], ['e', 'f']]
n = len(l)
output = []
for i in range(2 ** n):
    s = []
for k in range(n):
    if 2 ** k & i:
        s = s + l[k]
output.append(s)
Python all combinations of a list of lists