Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python dict sortieren

# dict has no order - use a list to store
l = {1: 40, 2: 60, 3: 50, 4: 30, 5: 20}
d1 = list(sorted(l.items(),key=lambda x:x[1],reverse=True))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #dict #sortieren
ADD COMMENT
Topic
Name
7+2 =