Sort a list in python and then return the index of elements in sorted order.
Input : [2, 3, 1, 4, 5] Output : [2, 0, 1, 3, 4] After sorting list becomes [1, 2, 3, 4, 5] and their index as [2, 0, 1, 3, 4] Input : [6, 4, 7, 8, 1] Output : [4, 1, 0, 2, 3] After sorting the list becomes [1, 4, 6, 7, 8] and their index as [4, 1, 0, 2, 3].
[2, 0, 1, 3, 4]
[2, 0, 1, 3, 4]
- Python | Add list elements with a multi-list based on index
- Python | Replace elements in second list with index of same element in first list
- Python | Convert list of string into sorted list of integer
- Python | Sort list of list by specified index
- Python | Indices of sorted list of list elements
- Python list | index()
- Python | Accessing index and value in list
- Python | Index of Non-Zero elements in Python list
- Python | Check for Nth index existence in list
- Python | Equate two list index elements
- Python | Subgroups of i'th index size in list
- Python | Initializing dictionary with list index-values
- Python | Print list after removing element at given index
- Python | Find minimum of each index in list of lists
- Python | Index specific cyclic iteration in list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.