Hackerss.com

Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in
hackerss
hackerss

Posted on

Python Imprimir si un numero es par

Imprimir si un numero es par - Python


def is_even(num):
    """
    Check if a number is even.

    Parameters
    ----------
    num : int
        Number to check.

    Returns
    -------
    bool
        ``True`` if ``num`` is even, ``False`` otherwise.
    """

    #return True if the number is even, False otherwise
    return num % 2 == 0

#example
result = is_even(8)
#output
print(result)  #True


Enter fullscreen mode Exit fullscreen mode

Top comments (0)