My concern involves one of my variables which have tuples within a list as follows.
test = [(['a','b','c'],[3,2,5]),(['d','e','f'],[1,5,6]),(['g','h','j'],[1,2,4])]
I am trying to get the summation of the second tuple element of the lists for example [3,2,5] and sort them based on that summation. so the result of that summation should be.
result1 = [(['a','b','c'],[10]),(['d','e','f'],[12]),(['g','h','j'],[7])]
then my intended final result should be sorted in descending order.
result = [['d','e','f'],['a','b','c'],['g','h','j']]