Python - 2d list max based on certain part of inner list
So I have a 2-dimensional list (as in a list of lists) and I'm trying to find the largets inner list based on their third element.
This is what I have so far, but it only returns j, not the entire list j where j is the biggest.
big = max([int(j) for j in cur2])
What I want it to do is return the entire max list out of each of the lists inside of cur2 dependent on the size of int(j)
Please don't refer to this question because I don't really understand how to apply that answer to my situation.
max( cur2, key=lambda x:int(x))
>>> cur2=[range(4),range(4,8),range(2,6)] >>> cur2 [[0, 1, 2, 3], [4, 5, 6, 7], [2, 3, 4, 5]] >>> max( cur2, key=lambda x:int(x)) [4, 5, 6, 7]