Python中如何得到數組或者列表按大小排序的索引

(1)自定義方法html myList = [1, 2, 3, 100, 5] index_list=[i[0] for i in sorted(enumerate(myList), key=lambda x:x[1])] enumerate(myList)返回一個包含(index,value)元組的列表數組 [(0, 1), (1, 2), (2, 3), (3, 100), (4, 5)] 經
相關文章
相關標籤/搜索