I would like to generate all combinations of values which are in lists indexed in a dict:
{\'A\':[\'D\',\'E\'],\'B\':[\'F\',\'G\',\'H\'],\'C\':[\'I\',\'J\']}
from itertools import combinations a=['I1','I2','I3','I4','I5'] list(combinations(a,2))
The output will be:
[('I1', 'I2'), ('I1', 'I3'), ('I1', 'I4'), ('I1', 'I5'), ('I2', 'I3'), ('I2', 'I4'), ('I2', 'I5'), ('I3', 'I4'), ('I3', 'I5'), ('I4', 'I5')]