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 Validar si un ao es bisiesto


def bisiesto(year):
    """
    Funcion que valida si un año es bisiesto
    :param year: año a validar
    :return: True si es bisiesto, False si no lo es
    """
    if year % 4 == 0 and year % 100 != 0 or year % 400 == 0:
        return True
    else:
        return False

print(bisiesto(2020))
print(bisiesto(2019))
print(bisiesto(2000))
print(bisiesto(1900))
Enter fullscreen mode Exit fullscreen mode

Top comments (0)