import operatorx = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0}sorted_x = sorted(x.items(), key=operator.itemgetter(1))print(sorted_x)
Standard input is empty
[(0, 0), (2, 1), (1, 2), (4, 3), (3, 4)]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!