0 out of 464 challenges solved
Write a function `add_tuple(test_list, test_tup)` that takes a list `test_list` and a tuple `test_tup` as input and returns a new list with the elements of the tuple appended to the list. #### Example Usage ```python [main.nopy] result = add_tuple([1, 2, 3], (4, 5)) print(result) # Output: [1, 2, 3, 4, 5] result = add_tuple([], (7, 8)) print(result) # Output: [7, 8] ```
def add_tuple(test_list, test_tup):
"""
Appends the elements of a tuple to a list and returns the resulting list.
Args:
test_list (list): The original list.
test_tup (tuple): The tuple to append.
Returns:
list: The list with the tuple elements appended.
"""
# Your code here
pass