我有字典 {'Bill': 4, 'Alex' : 4, 'Bob' : 3, "Charles": 7}
{'Bill': 4, 'Alex' : 4, 'Bob' : 3, "Charles": 7}
我需要先按字母顺序排序这个词典,然后按字母顺序排序.如果2个项目具有相同的数字键,则需要按字母顺序排序.
这个的输出应该是 Bob, Alex, Bill, Charles
Bob, Alex, Bill, Charles
我尝试使用lambda,list comprehension等,但我似乎无法让它们正确排序.
python sorting dictionary
dictionary ×1
python ×1
sorting ×1