title: python: iterate over dictionary sorted by key
body: <p>I have a Python dictionary</p>
  <pre><code>steps = {1:&quot;value1&quot;, 5:&quot;value2&quot;, 2:&quot;value3&quot;}
  </code></pre>
  <p>I need to iterate over this sorted by 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>