i have a list of tuples which is :
[('g', 10, 2), ('o', 6, 11), ('v', 2, 4), ('t', 1, 15), ('x', 40, 3), ('m', 4, 4), ('k', 10, 2), ('f', 14, 1), ('p', 70, 90), ('l', 21, 7), ('n', 1, 27), ('a', 39, 70), ('d', 11, 10), ('h', 21, 10), ('c', 10, 19), ('b', 8, 1), ('e', 30, 39), ('i', 23, 29), ('r', 8, 7), ('q', 2, 2), ('s', 18, 86)]
and I'm struggling about how to sort them so they can be placed like this:
[('p', 70, 90), ('a', 39, 70), ('s', 18, 84), ('è', 27, 45), ('e', 30, 39), ('i', 23, 29), ('x', 40, 3), ('h', 21, 10), ('c', 10, 19), ('l', 20, 7), ('d', 11, 10), ('o', 6, 11), ('t', 1, 15), ('f', 14, 1), ('r', 8, 7), ('g', 10, 2), ('k', 10, 2), ('n', 1, 11), ('b', 8, 1), ('m', 4, 4), ('v', 2, 4), ('q', 2, 2)]
It should be the addition of the second and third element of the tuple , and when they are the same ex. (a,10,9)
and (b,9,10)
they should be sorted alphabetically. It's written in python 3.5 and I can't call any library