Apr-01-2018, 11:30 PM
(This post was last modified: Apr-01-2018, 11:30 PM by jarrod0987.)
I tried reading the documentation but it's a little overwhelming.
I have a list of strings. The length of the list and the length of the strings can change in unpredictable ways.
I want to write simple function that will work every time.
Suppose I have a list like this...
Sorry, I don't know how to word what I mean.
Example:
ABJQ CBJQ FBJQ AGJQ CGJQ FGJQ AHJQ CHJQ FHJQ ABKQ CBKQ.....etc etc
I suspect itertools has a way to do this but there's too many options and I can't find it.
Thanks.
Edit: Never mind. Took about 30 minutes on YouTube but I found out itertools.product will probably work. Just need to figure out how to deal with the fact the list can vary in length now. :D
I have a list of strings. The length of the list and the length of the strings can change in unpredictable ways.
I want to write simple function that will work every time.
Suppose I have a list like this...
['ACF', 'BGH', 'JKLM', 'QWE']What I want to do is generate all possible combinations but each "Digit" is only allowed to be from its own item in the list.
Sorry, I don't know how to word what I mean.
Example:
ABJQ CBJQ FBJQ AGJQ CGJQ FGJQ AHJQ CHJQ FHJQ ABKQ CBKQ.....etc etc
I suspect itertools has a way to do this but there's too many options and I can't find it.
Thanks.
Edit: Never mind. Took about 30 minutes on YouTube but I found out itertools.product will probably work. Just need to figure out how to deal with the fact the list can vary in length now. :D