if not L:
    raise ValueError('my_max() arg is an empty sequence')
if key is None:
    key = lambda x: x
max_item, max_size = L[0], key(L[0])
for item in L[1:]:
    if key(item) > max_size:
        max_item, max_size = item, key(item)
return max_item
Python - return largest of N lists