pets = [('dog', 12, 2), ('cat', 15, 1), ('dog', 11, 1), ('cat', 15, 2), (
    'dog', 10, 3), ('cat', 16, 3)]

def my_reduce(obj1, obj2):
    return obj1[0], max(obj1[1], obj2[1]), min(obj1[2], obj2[2])
Reduce by key in python