so have problem can't head around, can give pseudocode @ best. lista=(a,b,c) listb=(a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3) i need way limit results of permutations of listsb following criteria: a tuple of items contained in lista the order of lista needs retained the permutations can right lista , list b can length for example: acceptable: a1,b1,c1 a2,b3,c3 unacceptable: a1,b1,d1 a2,b1,c3 b2,a2,c3 any ideas have appreciated! thanks i'm not sure calling "permutations", since seems want one-of-each combination. probably straightforward write own recursive generator. used string operations , startswith determine association between lista , listb ; can want if have different objects. lista=('a','b','c') listb=('a1','b1','c1','d1','a2','b2','c2','d2','a3','b3','c3','d3') def gen_combos(li, keepers, builder=tuple...
Comments
Post a Comment