Can someone elaborate on how the below statements work?
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..
>>> student_tuples = [
        ('john', 'A', 15),
        ('jane', 'B', 12),
        ('dave', 'B', 10),
]
>>> sorted(student_tuples, key=lambda student: student[2])   # sort by age
[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]
