how do i combine n items from iterable1 with m items from iterable2?
i.e.
iterable1 = [0,1,2,3,4]
iterable2 = ['a','b','c']
BlackBox(itertools.combination(iterable1, 2),itertools.combination(iterable2, 1)) yields
(0,1,'a'), (0,1,'b'), (0,1,'c'), (0,2,'a'), (0,3,'a'), etc. Order doesn't matter
I’m receiving a list of elements, which may contain a wildcard which I then need to replace with all of the wildcard’s possible values. I check for the number of wildcards and need to add a combination of that many elements into my de-wildcarded list. In other words, iterable2 is all the possible values of the wildcard, m is the number of wildcards, iterable1 is the original list with all wildcards removed, and n is the number of desired items less m.
1 Answer