"SpreadTooThin" <[EMAIL PROTECTED]> writes:
> a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order
> 
> def cmp(i,j):  #to be defined in this thread.
> 
> a.sort(cmp)
> 
> print a
> [1,4,7,10,  2,5,8, 3,6,9]

def k(n): return (n-1) % 3, (n-1) // 3
a.sort(key=k)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to