title: Sort dictionary by value in python
body: <p>This is my dictionary :</p>
  
  <pre><code>d = {'jan': 50, 'feb': 30, 'march': 60, 'april': 50, 'may': 50, 'june': 60, 'july': 20}
  </code></pre>
  
  <p>I am expecting output like this :</p>
  
  <pre><code>d = {'jan': 50, 'april': 50, 'may': 50, 'march': 60, 'june': 60, 'feb': 30, 'july': 20}
  </code></pre>
  
  <p>When I run this program I am getting different output than expected :</p>
  
  <pre><code>d = {'jan': 50, 'feb': 30, 'march': 60, 'april': 50, 'may': 50, 'june': 60, 'july': 20}
  sortlist = sorted(d, key=d.get)
  print(sortlist)
  </code></pre>