I am using python and I believe the problem below can be solved using itertools but if there is another method please let me know.
If I have a variable set of lists (for illustration purposes let it be 3) and each contains a variable set of elements (elements could be strings, integers, lists).
An example:
[a,b,c] [d,e,f] [g,h,i]
How can I create (and access) all the total possible combinations (as a list preferably) choosing just one from each set?
i.e.
[a,d,g]
[a,d,h]
[a,d,i]
[a,e,g]
... (and so on)
Order does not matter so for the output I do not want [a,d,g] and [d,a,g] both to show, just [a,d,g].
If my question is not clear please let me know.
Also, if it helps we can consider all elements to be simple strings or integers but I would like a solution that takes in count the fact that the number of lists and the number of elements in each list is variable.