Answers for "python ordered indexs of a list"

0

python ordered indexs of a list

>>> s = [2, 3, 1, 4, 5, 3]
>>> sorted(range(len(s)), key=lambda k: s[k])
[2, 0, 1, 5, 3, 4]
>>>
Posted by: Guest on March-24-2021

Python Answers by Framework

Browse Popular Code Answers by Language