这段代码适用于 Python 2.7,我如何在 Python 3 中完成这项工作?
arestas = dict() edges = arestas.items() edges.sort(key=lambda x: x[1])
返回的错误是:
AttributeError: 'dict_items' 对象没有属性 'sort'
谢谢!
sorting lambda dictionary python-2.7 python-3.x
dictionary ×1
lambda ×1
python-2.7 ×1
python-3.x ×1
sorting ×1