how to rearrange a dictionary in python
<pre><code>dictionary = {(1,1):[(2,2),[(3,3),(4,4)],5]}

dictionary[(2,2)] = [(3,3),[(4,4),(5,5)],6]

dictionary[(3,3)] = [(4,4),[(5,5),(6,6)],7]

print dictionary
</code></pre>

<p>Above code gives output as:</p>

<pre><code>{(3, 3): [(4, 4), [(5, 5), (6, 6)], 7], (1, 1): [(2, 2), [(3, 3), (4, 4)], 5], (2, 2): [(3, 3), [(4, 4), (5, 5)], 6]}
</code></pre>

<p>But, I wanted the output in order as input provided i.e,</p>

<pre><code>{(1,1):[(2,2),[(3,3),(4,4)],5],(2,2):[(3,3),[(4,4),(5,5)],6],(3,3):[(4,4),[(5,5),(6,6)],7]}
</code></pre>

<p>How can  I rearrange the dictionary?</p>