0 out of 464 challenges solved

Element-wise List Division

Write a Python function `div_list(nums1, nums2)` that takes two lists of numbers, `nums1` and `nums2`, and returns a new list where each element is the result of dividing the corresponding elements of `nums1` by `nums2`. If the lists are of different lengths, raise a `ValueError`. If division by zero occurs, raise a `ZeroDivisionError`.

#### Example Usage
```python [main.nopy]
print(div_list([4, 5, 6], [1, 2, 3]))  # Output: [4.0, 2.5, 2.0]
print(div_list([3, 2], [1, 4]))        # Output: [3.0, 0.5]
print(div_list([90, 120], [50, 70]))  # Output: [1.8, 1.7142857142857142]
```

#### Constraints
- Both input lists must be of the same length.
- Division by zero should be handled appropriately.
def div_list(nums1, nums2):
    """
    Divides elements of two lists element-wise.

    Args:
        nums1 (list): The first list of numbers.
        nums2 (list): The second list of numbers.

    Returns:
        list: A list containing the element-wise division results.

    Raises:
        ValueError: If the input lists are of different lengths.
        ZeroDivisionError: If division by zero is attempted.
    """
    # Check if the lists are of the same length
    # Perform element-wise division
    pass