My test dict is
d = {0:'5',28:'5', 23:'5', 21:'5'}
and I wrote the code
kk = {key:d[key] for key in sorted(d.keys())}
which shows the result
{0: '5', 28: '5', 21: '5', 23: '5'}
but I need
{0: '5', 21: '5', 23: '5', 28: '5'}
How can I get the desired result?