title: How do I sort a dictionary while retaining its keys?
body: <p>I know it's possible to sort a dict for its values using this:</p>
  
  <pre><code>&gt;&gt;&gt; mydict = {'silver': 300, 'gold': 500, 'bronze': 100, 'platinum': 1000}
  &gt;&gt;&gt; items = mydict.items()
  &gt;&gt;&gt; print sorted([value for key, value in items])
  [100, 300, 500, 1000]
  </code></pre>
  
  <p>But what if I want to sort the values <em>inside</em> the dict so I still have the keys? The output should look like this:</p>
  
  <pre><code>{'platinum': 1000, 'gold': 500, 'silver': 300, 'bronze': 100}
  </code></pre>
  
  <p>Is there any method to achieve this?</p>