leap = False
if year % 4 == 0 and (year % 400 == 0 or year % 100 != 0):
leap = True
return leap
year = int(input())
print(is_leap(year))
A leap year is a year containing one additional day added to keep the calendar year synchronized with the astronomical or seasonal year. Because seasons and astronomical events do not repeat in a whole number of days, calendars that have the same number of days in each year drift over time with respect to the event that the year is supposed to track. By inserting (also called intercalating) an additional day or month into the year, the drift can be corrected. A year that is not a leap year is called a common year.
For example, in the Gregorian calendar, each leap year has 366 days instead of 365, by extending February to 29 days rather than the common 28 days. Adding one extra day to the calendar every four years compensates for the fact that a period of 365 days is shorter than a tropical year by almost 6 hours. Some exceptions to this basic rule are required since the duration of a tropical year is slightly less than 365.25 days. For example, in each cycle of 400 years, there are 97 leap years of 366 days and 303 years of 365 days (303 × 365 + 97 × 366 = 146097), so on average (over any interval), the calendar advances one day in 240 years.(http://en.wikipedia.org/wiki
def is_leap(year):
Tomy is a contributor at AskMeCode. We are committed to providing well-researched, accurate, and valuable content to our readers.
You May Also Like
How To Maximize Your Learning Experience With my code
my code is committed to helping you reach your full potential. Founded in 2013, my code is a blog about...
What Newbies Should Know Before Learning Python
I’ve been learning a lot of different languages and I want to share my experience with Python, my favorite language...
A Guide to SVG Animation
SVG animation is a great way to add visual interest to your site. It can also be a key component...
What Is Code? Why Learn It And How? A blog that talks about the importance of code and why you should learn it
Do you want to be a software engineer and get paid to code? Or, maybe you want to use coding...
