我有一本字典:
db = {'Carl': [('Intel', 30, 40), ('Dell', 20, 50), ('Intel', -10, 60), ('Apple', 20, 55)], 'Barb': [('Intel', 20, 40), ('Intel', -10, 45), ('IBM', 40, 30), ('Intel', -10, 35)], 'Alan': [('Intel', 20, 10), ('Dell', 10, 50), ('Apple', 80, 80), ('Dell', -10, 55)], 'Dawn': [('Apple', 40, 80), ('Apple', 40, 85), ('Apple', -40, 90)]}
以及一个接受dict参数的函数:
^{pr2}$我想根据键值的长度按降序返回键列表。我已经在上面的函数中这样做了,但是我不确定如果它们具有相同长度的值,如何按字母顺序递增返回它们。在
相关问题 更多 >
编程相关推荐