I have found a code that orders the elements of a list according to the grades specifid in the tuples that constitute the list. I cannot understand how it works though: shouldn't be specified somewhere that the parameter data is referred to the students list? Thanks
students = [("Squidwaard", "F", 60),
("Sandy", "A", 33),
("Patrick", "D", 36),
("Spongebob", "B", 20),
("Mr.Krabs", "C", 78)]
grade = lambda data: data[1]
students.sort(key=grade)
for i in students:
print(i)