I have the following two lists in Python3:
list1 = [(3, 2), (1, 5), (4, 2), (2, 0)]
list2 = [(1, 6), (2, 1), (3, 3), (4, 0)]
Each tuple in the list is of the form (id, score). I want to combine the scores from the two list for each id separately, and then sort by descending scores. So, the output should be:
list3 = [(1, 11), (3, 5), (4, 2), (2, 1)]
What's the easiest way to do this?