On Apr 1, 2005, at 09:59, Alan Gauld wrote:

Since the data are obviously related (since you need to keep them
linked),
I'd be inclined to merge the lists into a list of tuples

merged = [(a,b,c,d) for a in l1 for b in l2 for c in l3 for d in l4]

Then you can sort 'merged' and it should just work.... The default
sort will order the tuples by the first member...

Alan G.

What's the advantage of this compared to the "zip" method (which yields the same result AFAICT)?


-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my corridors... How can you challenge a perfect, immortal machine?"



_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Reply via email to