0 out of 464 challenges solved
Write a Python function `average_tuple` that takes a tuple of tuples containing numerical values and returns a list of average values for each position across the tuples. #### Example Usage ```python [main.nopy] print(average_tuple(((10, 10, 10, 12), (30, 45, 56, 45), (81, 80, 39, 32), (1, 2, 3, 4)))) # Output: [30.5, 34.25, 27.0, 23.25] print(average_tuple(((1, 1, -5), (30, -15, 56), (81, -60, -39), (-10, 2, 3)))) # Output: [25.5, -18.0, 3.75] print(average_tuple(((100, 100, 100, 120), (300, 450, 560, 450), (810, 800, 390, 320), (10, 20, 30, 40)))) # Output: [305.0, 342.5, 270.0, 232.5] ``` #### Constraints - The input will always be a tuple of tuples with at least one tuple. - Each inner tuple will contain at least one numerical value.
def average_tuple(nums): """ Calculate the average value for each position across all tuples. Args: nums (tuple of tuples): A tuple containing tuples of numerical values. Returns: list: A list of average values for each position. """ # Placeholder for the solution pass