fenngwd
1/28/2018 - 9:42 AM

[Sort Dict By Value] Sort Dict By Value

[Sort Dict By Value] Sort Dict By Value

import operator
x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0}
sorted_x = sorted(x.items(), key=operator.itemgetter(1))