0

Sort formula + lambda

Can anyone help me to interpret this code? list = [3, 4, 2, 5] s = sorted(range(len(list)), key = lambda i: list[i]) print(sorted(list)) print(s) #>>>>>>>>>>>> [2, 3, 4, 5] #>>>>>>>>>>>> [2, 0, 1, 3]

19th Dec 2018, 11:00 AM
Hamed Tabari
Hamed Tabari - avatar
1 Resposta
0
Thanks
19th Dec 2018, 11:23 AM
Hamed Tabari
Hamed Tabari - avatar