Leap Year Check
Leap years keep the calendar aligned with Earth’s movement around the Sun. The function leap_year receives a year year and checks this rule: a year is leap if it is divisible by 4 but not by 100, unless it is also divisible by 400. Return True for a leap year and False for a regular year.
Примеры
Ввод
2000Вывод
TrueВвод
1900Вывод
FalseВвод
2024Вывод
TrueНужно реализовать
def leap_year(year: int) -> bool:
Теги
math
Prisijunkite, kad matytumėte pateikimų istoriją
PrisijungtiPrisijunkite, kad naudotumėte DI mentorių
PrisijungtiVisible tests
1
Input
2000Expected
True2
Input
1900Expected
False3
Input
2024Expected
True4
Input
2023Expected
False5
Input
1600Expected
True6
Input
2100Expected
FalseFocus radio
Paused · SomaFM · Fluid