I have the following list of tuples --
[( one ,[1,2,5,3,9,8]), ( two ,[9,8,5,1])]
And need to sort the nested list, while keeping the ordering of the tuples as is --
[( one ,[1,2,3,5,8,9]), ( two ,[1,5,8,9])]
我现在这样做的方法是<<>>>> loop>——
list_of_tuples = [( one ,[1,2,5,3,9,8]), ( two ,[9,8,5,1])]
sorted_list_of_tuples = []
for item1, item2 in list_of_tuples:
sorted_list_of_tuples.append((item1, sorted(item2))
在一个方面这样做是否容易? 谢谢。