Combinatorial of elements in Python?

Sebastian Bassi sbassi at clubdelarazon.org
Wed Aug 15 01:03:41 EDT 2007


I have 2 (or more) groups of elements, and I want to get all possible
unique combinations from all of them. Is there a build-in method to do
it?

ADictionary={"one":["A","B","C","D"],"two":["H","I"]}

I want to have all possible combinations from "one" and "two", that is:

AH
BI
CH
DI
AI
BH
CI
DH

Sounds easy, but is not :)


-- 
Sebastián Bassi (セバスティアン)
Diplomado en Ciencia y Tecnología.
GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D


More information about the Python-list mailing list