• + 0 comments

    It’s a tricky question to answer. We have three main conditions for leap years: * If the year is evenly divisible by 4, it is a leap year, unless: (year % 4 == 0) * If the year is evenly divisible by 100, it is NOT a leap year, unless: (year % 100 != 0) * However, if the year is also evenly divisible by 400, then it is a leap year: (year % 400 == 0)

    To determine if a year is a leap year, conditions 1 and 2 must both evaluate to True or False. Otherwise, compare condition 3 (year % 400 == 0) directly.