arr = [12, 6, 8, 3, 10, 1, 0, 9] a = zip(xrange(len(arr)), arr) a.sort(key=lambda e: e[1], reverse=1) print '\n'.join('{0} -> {1}'.format(x, y) for x, y in a[:3])
#初心者用
a = [12, 6, 8, 3, 10, 1, 0, 9] for i in range(3): b = max(a) z = min(a) c = a.index(b) print str(c) + " -> " + str(b) a[c] = z - 1