問題文
arr = [12, 6, 8, 3, 10, 1, 0, 9] a = zip(range(len(arr)), arr) a.sort(cmp=lambda x,y: cmp(x[1], y[1]), reverse=True) print '\n'.join('%d -> %d' % (x, y) for x, y in a[:3])