title: Sorting by value and key
body: <p>I was searching for something to sort a list of pairs by values and keys in Python. I have found this:</p>
  
  <pre><code>list.sort(key=lambda (k, v): (-v, k))
  </code></pre>
  
  <p>How does this lambda function work?</p>