On 10/16/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > >>> a = [1,2,3,4,5,6,7,8,9,10] > >>> a.sort(key=lambda item: (((item-1) %3), item)) > >>> a > [1, 4, 7, 10, 2, 5, 8, 3, 6, 9]
Re-reading the OP's post, perhaps sorting isn't what's required: >>> a[::3] + a[1::3] + a[2::3] [1, 4, 7, 10, 2, 5, 8, 3, 6, 9] -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list