0 out of 464 challenges solved
Write a Python function `opposite_signs(x, y)` that checks whether two given integers have opposite signs. The function should return `True` if the integers have opposite signs and `False` otherwise. #### Example Usage ```python [main.nopy] print(opposite_signs(1, -2)) # Output: True print(opposite_signs(3, 2)) # Output: False print(opposite_signs(-10, -10)) # Output: False print(opposite_signs(-2, 2)) # Output: True ``` #### Constraints - The function should handle both positive and negative integers. - Zero is considered to have no sign, so any comparison involving zero should return `False`.
def opposite_signs(x, y): """ Check if two integers have opposite signs. Args: x (int): The first integer. y (int): The second integer. Returns: bool: True if x and y have opposite signs, False otherwise. """ # Implement the logic to check for opposite signs pass