feat: add leap year

This commit is contained in:
2025-08-30 14:50:49 +08:00
parent 295135af7f
commit f560834bc4

9
leap_year.py Normal file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env python3
def is_leap_year(year):
return year % 4 == 0 and year % 100 != 0 or year % 400 == 0
if __name__ == "__main__":
print(1582, is_leap_year(1582))
print(2000, is_leap_year(2000))
print(2100, is_leap_year(2100))