python根据key对字典进行排序 dic={'name':'laohu','age':20,'length':22} res =sorted(dic.items(),key=lambda x:x[0],reverse=True) print(res)