title: How to sort a dict by one of its values in Python?
body: <p>I have a dict like this:
  key is a string,
  value is a list of strings</p>
  
  <pre><code>    my_dict = {
      'key1': [value11, value12, value13],
      'key2': [value21, value22, value23],
      'key3': [value31, value32, value33],
      'key4': [value41, value42, value43]
  }
  </code></pre>
  
  <p>e.g.</p>
  
  <pre><code>dict_0 = {
  'key1' : [lv, 2, abc],
  'key2' : [ab, 4, abc],
  'key3' : [xj, 1, abc],
  'key4' : [om, 3, abc],
  }
  </code></pre>
  
  <p>I wanted to be sorted based on the second value in the value list, so, it should be like this:</p>
  
  <pre><code>dict_0 = {
  'key3' : [xj, 1, abc],
  'key1' : [lv, 2, abc],
  'key4' : [om, 3, abc],
  'key2' : [ab, 4, abc],
  }
  </code></pre>
  
  <p>I want to sort this dict by one of the value in the value list, i.e. value*2, how can I do this?
  I've searched extensively on the site, but didn't find a similar case.</p>
  
  <p>Thanks.</p>