title: Sorting Python dictionary based on nested dictionary values
body: <p>How do you sort a Python dictionary based on the inner value of a nested dictionary?</p>
  
  <p>For example, sort <code>mydict</code> below based on the value of <code>context</code>:</p>
  
  <pre><code>mydict = {
      'age': {'context': 2},
      'address': {'context': 4},
      'name': {'context': 1}
  }
  </code></pre>
  
  <p>The result should be like this:</p>
  
  <pre><code>{
      'name': {'context': 1}, 
      'age': {'context': 2},
      'address': {'context': 4}       
  }
  </code></pre>