我需要在 Python 中对以下元组列表进行排序:
ListOfTuples = [('10', '2010 Jan 1;', 'Rapoport AM', 'Role of antiepileptic drugs as preventive agents for migraine', '20030417'), ('21', '2009 Nov;', 'Johannessen SI', 'Antiepilepticdrugs in epilepsy and other disorders--a population-based study of prescriptions', '19679449'),...]
我的目的是按降序年份(listOfTuples[2])和升序作者(listOfTuples[2])排序:
sorted(result, key = lambda item: (item[1], item[2]))
但它不起作用。我怎样才能获得排序稳定性?