最佳答案
我有一个元组列表,它看起来像这样:
("Person 1",10)
("Person 2",8)
("Person 3",12)
("Person 4",20)
What I want produced, is the list sorted in ascending order, by the second value of the tuple. So L[0] should be ("Person 2", 8)
after sorting.
我该怎么做呢? 使用 Python 3.2.2,如果有帮助的话。