问题描述:
Write a function to extract the sum of alternate chains of tuples.

测试用例:
['assert sum_of_alternates((5, 6, 3, 6, 10, 34)) == (46, 18)', 'assert sum_of_alternates((1, 2, 3, 4, 5)) == (6, 9)', 'assert sum_of_alternates((6, 7, 8, 9, 4, 5)) == (21, 18)']

生成的代码:
def sum_of_alternates(tup):
    odd_sum = 0
    even_sum = 0
    for index, value in enumerate(tup):
        if index % 2 == 0:
            even_sum += value
        else:
            odd_sum += value
    return (even_sum, odd_sum)

# Test cases
assert sum_of_alternates((5, 6, 3, 6, 10, 34)) == (46, 18)
assert sum_of_alternates((1, 2, 3, 4, 5)) == (6, 9)
assert sum_of_alternates((6, 7, 8, 9, 4, 5)) == (21, 18)