> I need to sort 4 lists but I need that they make the "sort together". > I'll sort just one but when I change the position of the items of the > 1st list I have to change the positions of the other 3 lists. Can I do > this just using the sort() method of the list object? > If I can't, someone know a site that have one sort method in python that > its easily to implement and fast?
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. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor