a=[54,876,45,34,45,13,86]
sorted_id = sorted(range(len(a)),key = lambda k:a[k] )
print(sorted_id)
输出为[5, 3, 2, 4, 0, 6, 1]
2024-02-28 21:31:04
a=[54,876,45,34,45,13,86]
sorted_id = sorted(range(len(a)),key = lambda k:a[k] )
print(sorted_id)
输出为[5, 3, 2, 4, 0, 6, 1]