I\'m trying to figure out the best way to merge two lists into all possible combinations. So, if I start with two lists like this:
list1 = [1, 2]
list2 = [3,
You can create a list by constructing all the permutations of two list members with this, containing the list combinations.
lst1 = [1,2]
lst2 = [3,4]
#lst = [[j,k] for j in lst1 for k in lst2] # [[1,3],[1,4],[2,3],[2,4]]
lst = [[[j,k] for j in lst1] for k in lst2] # [[[1,3],[2,3]],[[1,4],[2,4]]]
print lst