temp = {} temp["A"] = 5.3 temp["B"] = 2.3 temp["C"] = 10.3 t1 = [] t1 = sorted(temp,key=temp.get,reverse=True) print (t1) t2 = [] t2 = sorted(temp.values(),reverse=True) print (t2)
['C', 'A', 'B'] [10.3, 5.3, 2.3]