【发布时间】:2019-05-15 16:43:54
【问题描述】:
mylist = [('Action',1) , ('Horror',2) , ('Adventure',0) , ('History',2) , ('Romance',1) ,('Comedy',1)]
我有一个这样的元组列表:
Action: 1
Horror: 2
Adventure: 0
History: 2
Romance: 1
Comedy: 1
我想按两个元素(名称(按字母顺序)和值)对此进行排序
我的结果应该是:
History: 2
Horror: 2
Action: 1
Comedy: 1
Romance: 1
Adventure: 0
【问题讨论】:
标签: sorting