0 out of 464 challenges solved
Write a Python function `is_even(n)` that checks whether a given integer `n` is even. The function should return `True` if the number is even and `False` otherwise. #### Example Usage: ```python [main.nopy] print(is_even(2)) # Output: True print(is_even(3)) # Output: False print(is_even(0)) # Output: True ``` #### Requirements: - Use bitwise operations to determine if the number is even. - Do not use the modulo operator `%` or division `/`. Implement the function and ensure it works for both positive and negative integers.
def is_even(n): """ Check if the given number is even using bitwise operations. Args: n (int): The number to check. Returns: bool: True if the number is even, False otherwise. """ # Implement the logic to check if the number is even pass