Jan-27-2021, 09:49 AM
I'm not sure where the variables are coming from, but you can pass them into itertools.product to get the list that you want from them.
>>> from itertools import product >>> list(product(("a","ap"), ("b", "bp"), ("c", "cp"))) [('a', 'b', 'c'), ('a', 'b', 'cp'), ('a', 'bp', 'c'), ('a', 'bp', 'cp'), ('ap', 'b', 'c'), ('ap', 'b', 'cp'), ('ap', 'bp', 'c'), ('ap', 'bp', 'cp')]