best = [ [1024, 768], [800, 600], [640, 480] ] (it's larger) modes = [ (24, [1280, 1024]), (24, [1024, 768]), (24, [640, 480]), (16, [1600, 1200]), (16, [1280, 1024]), (15, [320, 200]), ]
I want to create a list with ALL elements of 'modes', but following the order of list 'best' (if exist the number). At the end the rest of numbers in modes, are added too. And all this for each modes[0] (24, 16, 15, ...) For a simple list is easy: a = [123, 45, 98, 2, 12]; b=[12, 35, 45, 2] [y for y in b if y in a] + [x for x in a if x not in b] Help please, that i'm going crazy v 2.3.5 Thanks in advance _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor