l = [1,9,3,4,9,8,5,7,5,8,3,0,2,8,4] def s(a,b): return a < b print l l.sort(s) print l