Possible duplicate:
Get the Cartesian product of a series of lists in Python
I'm trying to understand some kind of logic with which I just canโt wrap my head around it. Let's say I have the following data structure:
letters = ( ('b','c'), ('a','e','ee'), ('d','f'), ('e','y'), )
How would I iterate over this to get all possible string combinations:
bade cade bede cede beede ceede bafe cafe befe cefe beefe ceefe bady cady bedy cedy beedy ceedy bafy cafy befy cefy beefy ceefy
source share