В Python 3.
>>> D1 = {2:3, 1:89, 4:5, 3:0} >>> for key in sorted(D1): print (key, D1[key])
дает
1 89 2 3 3 0 4 5