我正在将一些代码从Python 2移植到3.这是Python 2语法中的有效代码:
def print_sorted_dictionary(dictionary): items=dictionary.items() items.sort()
在Python 3中,dict_items没有方法'sort' - 我如何在Python 3中为此做出解决方法?
python python-3.x
python ×1
python-3.x ×1