def is_leap(year):

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):

leap = False

Tomy

Tomy is a contributor at AskMeCode. We are committed to providing well-researched, accurate, and valuable content to our readers.

You May Also Like

Why You Need a Version Backup Solution For Your Low Code Platform

Why You Need a Version Backup Solution For Your Low Code Platform

A versioning system is the answer to a lot of common problems that developers face. It saves time, reduces risk...

How To Use Markdown with VS Code

How To Use Markdown with VS Code

The Markdown language is an easy way to add formatting, like headers, bold, bulleted lists, and so on, to plain...

Artistic representation for Best Full-Stack Development Tips and Strategies

Best Full-Stack Development Tips and Strategies

The Green Path to Mastery in Full-Stack Web Development In an era where sustainability is reshaping every industry, full-stack web...

Artistic representation for Quick Programming Languages Solutions Under 30 Minutes

Quick Programming Languages Solutions Under 30 Minutes

Programming Languages That Power Sustainable Innovations in Under 30 Minutes In today’s digital age, programming languages are the foundation of...

Leave a Reply

About | Contact | Privacy Policy | Terms of Service | Disclaimer | Cookie Policy
© 2026 AskMeCode. All rights reserved.