students = [["White", "Snow", 9, "F", 3.56],
["Sprat", "Jack", 12, "M", 2.0],
["Contrary", "Mary", 9, "F", 3.674],
["Dumpty", "Humpty", 11, "M", 2.342],
["Bunny", "Easter", 10, "M", 4.233],
["Wonderland", "Alice", 10, "F", 3.755],
["Bunyon", "Paul", 11, "M", 1.434],
["Penny", "Henny", 9, "F", 2.54],
["Hatter", "Mad", 11, "M", 4.522],
["Munk", "Chip", 10, "M", 3.0],
["Hood", "Red Riding", 10, "F", 3.137],
["Bunny", "Bugs", 11, "M", 2.12],
["Duck", "Daffy", 11, "M", 3.564],
["Ant", "Atom", 12, "M", 3.333],
["Mouse", "Mickey", 10, "M", 3.975],
["Brown", "Charlie", 9, "M", 1.25]]
在嵌套列表中有五个不同的列表。如何排序最后一列(第5列),而不是整个嵌套列表
这就是你想要的:
你可以使用itemgetter
请尝试以下操作: 编辑:改为打印每行的排序列表的函数
结果应该是这样的: 函数按每个列表最后一个值中的数字排序
相关问题 更多 >
编程相关推荐