Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python dictionary sort in descending order

dict = {"Python":750,"Java":950,"Ruby":700,"C++":200} 
 
sort_values = sorted(dict.items(), key=lambda y: y[1], reverse=True)

for i in sort_values:
	print(i[0], i[1])
 
PREVIOUS NEXT
Tagged: #python #dictionary #sort #descending #order
ADD COMMENT
Topic
Name
2+2 =