[Tutor] list issue.. i think

bruce badouglas at gmail.com
Fri Dec 23 03:11:43 CET 2011


hi.

got a test where i have multiple lists with key/values. trying to figure
out how to do a join/multiply, or whatever python calls it, where i have a
series of resulting lists/dicts that look like the following..

the number of lists/rows is dynamic..
the size of the list/rows will also be dynamic as well.

i've looked over the py docs, as well as different potential solns..

psuedo code, or pointers would be helpful.

thanks...

test data
a['a1']=['a1','a2','a3']
a['a2']=['b1','b2','b3']
a['a3']=['c1','c2','c3']

end test result::
a1:a1,a2:b1,a3:c1
a1:a2,a2:b1,a3:c1
a1:a3,a2:b1,a3:c1

a1:a1,a2:b2,a3:c1
a1:a2,a2:b2,a3:c1
a1:a3,a2:b2,a3:c1

a1:a1,a2:b3,a3:c1
a1:a2,a2:b3,a3:c1
a1:a3,a2:b3,a3:c1

a1:a1,a2:b1,a3:c2
a1:a2,a2:b1,a3:c2
a1:a3,a2:b1,a3:c2

a1:a1,a2:b2,a3:c2
a1:a2,a2:b2,a3:c2
a1:a3,a2:b2,a3:c2

a1:a1,a2:b3,a3:c2
a1:a2,a2:b3,a3:c2
a1:a3,a2:b3,a3:c2

a1:a1,a2:b1,a3:c3
a1:a2,a2:b1,a3:c3
a1:a3,a2:b1,a3:c3

a1:a1,a2:b2,a3:c3
a1:a2,a2:b2,a3:c3
a1:a3,a2:b2,a3:c3

a1:a1,a2:b3,a3:c3
a1:a2,a2:b3,a3:c3
a1:a3,a2:b3,a3:c3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111222/faeab37b/attachment.html>


More information about the Tutor mailing list