Using sorted() in Python
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8966538/syntax-behind-sortedkey-lambda">Syntax behind sorted(key=lambda :)</a>  </p>
</blockquote>



<p>I was going through the <a href="http://docs.python.org/howto/sorting.html" rel="nofollow">documentation</a> and came across this example:</p>

<blockquote>
  <p>student_tuples = [
      ('john', 'A', 15),
      ('jane', 'B', 12),
      ('dave', 'B', 10), ]</p>
  
  <p>sorted(student_tuples, key=lambda student: student[2])<br>
  #^ sort by age [('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]</p>
</blockquote>

<p>What I don't understand is what are lambda and student here? Can they be replaced by any other names? And does the : do in 'student:student[2]'? It's a little ambiguous since I've never come across this before.</p>
