Please, explain key function.
Maybe, you mean `key=lambda item: item[1]`, so python will sort all items by `item[1]` and then choose max.