0 out of 464 challenges solved
Write a Python function `mul_even_odd` that takes a list of integers as input and returns the product of the first even number and the first odd number in the list. If either an even or odd number is not found, return `-1`. #### Example Usage ```python [main.nopy] print(mul_even_odd([1, 3, 5, 7, 4, 1, 6, 8])) # Output: 4 print(mul_even_odd([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) # Output: 2 print(mul_even_odd([1, 5, 7, 9, 10])) # Output: 10 print(mul_even_odd([2, 4, 6, 8])) # Output: -1 print(mul_even_odd([1, 3, 5, 7])) # Output: -1 ``` #### Constraints - The input list will contain integers only. - The list may be empty, in which case the function should return `-1`. - The function should return `-1` if either an even or odd number is not found in the list.
def mul_even_odd(numbers): """ Returns the product of the first even and first odd number in the list. If either is not found, returns -1. Args: numbers (list): A list of integers. Returns: int: The product of the first even and first odd number, or -1. """ # Placeholder for the solution pass