📌  相关文章
📜  在 python 代码示例中对字典中的值进行排序

📅  最后修改于: 2022-03-11 14:46:06.092000             🧑  作者: Mango

代码示例2
#instead of using python inbuilt function we can it compute directly.
#here iam sorting the values in descending order..
d = {1: 1, 7: 2, 4: 2, 3: 1, 8: 1}
s=[]
for i in d.items():
  s.append(i)
for i in range(0,len(s)):
  for j in range(i+1,len(s)):
    if s[i][1]