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]
1 ответ
0
Thanks
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]