I have two lists [1,2,3]
and [4,5,6]
. I'd like to generate a list of all combinations as follows using itertools
ResultingList = [[1,4],[1,5],[1,6],[2,4],[2,5],[2,6],[3,4],[3,5],[3,6]]
So far I've only investigated the itertools.combinations
function which seems that it can only handle something like this:
list(itertools.combinations([1,2,3,4,5,6],2))
Which outputs an incorrect result. How can I generate ResultingList
above?
Thanks