python sort dictionary alphabetically by key

34

python sort dictionary alphabetically by key -

sortednames=sorted(dictUsers.keys(), key=lambda x:x.lower())

python dictionary sort by value then alphabetically -

sortedList = sorted(h, key=lambda k: (-k[1], k[0]))

Comments

Submit
0 Comments