Hackerss.com

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

Latest comments (0)