# sort a list in
Python 2.4 and greater on specific indices
# 0
1 2 3
4 5 6
7 8 9
10
lst1 = [12, 18,
22, 43, 23,
609965, 3264, 43762, 21, 33,
657]
lst2 = [177, 3445,
65, 785, -34,
65, 789, 33456, 34,
568876, 476]
lst3 = [0, 1,
2, 3, 4,
5, 6, 7,
8, 9, 10]
lst4 = [0, 1,
2, 3, 4,
5, 6, 7,
7, 9, 10]
lst5 = [0, 1,
2, 3, 4,
4, 6, 7,
7, 9, 10]
lst6 = [-1, 1,
2, 3, 4,
4, 6, 7,
7, 9, 10]
lst3 = [lst1,
lst2, lst3, lst4, lst5, lst6]
for item in lst3:
print item
print
lst4 = sorted(lst3, key=lambda i: (i[5], i[8], i[1]))
for item in lst4:
print item