You will write three functions about the Gregorian calendar.
The idea. A year is a leap year if it is divisible by , except that a century year is a leap year only if it is divisible by . A leap year has days and other years have .
Your tasks.
is_leap, return True for a leap year and False for another year.days_in_years, return the number of days from the first year to the last year, both included.mean_year, return the mean length of a year over those years, in days.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…