# -*- coding: utf-8 -*- #!/bin/env python # Python2.7 nums = [2, 4, 7, 0, 12, 6] print sorted(range(len(nums))) # ind是 列表nums 排序后值的索引 ind = sorted(range(len(nums)), key=lambda x: nums[x]) print ind L = [('b',2),('a',1),('e',3),('d',4)] print sorted(L…