May 2018
Intermediate to advanced
380 pages
9h 37m
English
In addition to implementing all common and mutable sequence operations, lists and tuples also have the following special method available to them:
As an example of how to use the key argument, assume you have a list of lists:
>>> l = [[3, 56], [2, 34], [6, 98], [1, 43]]
To sort this list, call the sort() method on the list, and then print the list. Without having a function that combines the two steps, they have to be called separately. This is ...