from functools import reduce
def mul(args):
    return reduce(lambda acc, x: acc * x, args, 1)
myList = [(0, 2), (1, 3), (2, 4), (0, 5), (1, 6)]
sorted_ = sorted(myList, key=itemgetter(0))
python sum tuple list based on tuple first value