I have this list of list of tuples
var1 = [
[(10, '♣'), (7, '♠')],
[(14, '♣'), (2, '♣')],
[(2, '♥'), (9, '♦')],
[(11, '♠'), (10, '♠')],
[(11, '♦'), (5, '♣')]
]
and I wanna extract the tuple with the maximun value which is the second one or var1[1]. I've used a lot of different codes during my programming but the one I'm using now and until now and didn't have any major issues is this one:
maximo = max(var1, key=lambda x: sum(i for i,_ in x))
also this one:
maximo2 = list(map(max,zip(*var1)))
The problem is I need the list with the biggest value, not the one with the combinations of the 2 biggest, and right now this code is outputting var1[3]
as the bigger of the 2 and I don't know what else to try.