0 out of 464 challenges solved
Write a Python function `division_elements` that takes in two tuples of numbers and performs element-wise division across the given tuples. The function should return a new tuple containing the results of the division for each corresponding pair of elements. #### Requirements: - The function should handle tuples of the same length. - Perform integer division (`//`) for each pair of elements. - Assume that the second tuple will not contain zeroes. #### Example Usage: ```python [main.nopy] result = division_elements((10, 4, 6, 9), (5, 2, 3, 3)) print(result) # Output: (2, 2, 2, 3) result = division_elements((12, 6, 8, 16), (6, 3, 4, 4)) print(result) # Output: (2, 2, 2, 4) result = division_elements((20, 14, 36, 18), (5, 7, 6, 9)) print(result) # Output: (4, 2, 6, 2) ``` #### Constraints: - Both input tuples will have the same length. - The second tuple will not contain zeroes.
def division_elements(tuple1, tuple2): """ Perform element-wise integer division on two tuples. Args: tuple1 (tuple): The first tuple of integers. tuple2 (tuple): The second tuple of integers. Returns: tuple: A tuple containing the results of element-wise integer division. """ # Perform element-wise integer division # Replace the following line with your implementation pass