python: iterate over dictionary sorted by key
<p>I have a Python dictionary </p>

<pre><code>steps = {1:"value1", 5:"value2", 2:"value3"}
</code></pre>

<p>I need to iterate over this is sorted order by the key.</p>

<p>I tried this:</p>

<pre><code>x = sorted(steps, key=lambda key: steps[key])
</code></pre>

<p>but the values are gone from x.</p>
