<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tuple_alter(tup, *pairs):
 """Return a copy of a tuple with some elements altered. :param tup: The tuple to be copied. :param pairs: Any number of (index, func) tuples where index is the index of the item to alter and the new value is func(tup[index]). """

    # timeit says that this is faster than a similar
    tuple_list = list(tup)
    for i, f in pairs:
        tuple_list[i] = f(tuple_list[i])
    return tuple(tuple_list)