#220 · Python Basics · Beginner · 30 XP · about 4 min
Most years have 365 days, but a leap year has 366: February gets a 29th day. Write is_leap(year) that returns True if year is a leap year and False if it is not.
The calendar uses three rules:
is_leap(2024) # returns True is_leap(1900) # returns False is_leap(2000) # returns True
1900 is divisible by 100 but not by 400, so it was not a leap year. 2000 is divisible by 400, so it was.
1 <= year <= 9999First solves only, ranked by stars and then time.