Python lamba function with Python sorted module
<p>Can someone elaborate on how the below statements work?</p>

<p>My question is related to the lambda function?  The lambda statement takes the student as the input and returns (student[2]) second element in the list. I understand we have the student_tuples as the list but how does the "Student" list is recognized by the Python lambda function..</p>

<pre><code>&gt;&gt;&gt; student_tuples = [
        ('john', 'A', 15),
        ('jane', 'B', 12),
        ('dave', 'B', 10),
]
&gt;&gt;&gt; sorted(student_tuples, key=lambda student: student[2])   # sort by age
[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]
</code></pre>
