What is lambda? How can you explain this sorting : <p>Please be gentle I'm still learning Python. I've an example where </p>

<blockquote>
  <p>pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')]</p>
  
  <p>pairs.sort(key=lambda pair: pair[1])</p>
</blockquote>

<p>The result is</p>

<blockquote>
  <p>[(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]</p>
</blockquote>

<p>Can you please help explain why this is the sequence?</p>
