Skip to content

This is the classic leap year finder program with python. This problem is labelled as "hard" on many practice sites, but actually the programming is not hard at all. What's hard is the description of the leap year and how to translate it into the programming language.

Notifications You must be signed in to change notification settings

pkx8326/leapyear_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Leap year with Python

This is the classic leap year finder program with python. This problem is labelled as "hard" on many practice sites, but actually the programming is not hard at all. What's hard is the description of the leap year and how to translate it into the programming language.

The leap year conditions:

  1. If a year is divisible by 4 then it is a leap year, "unless" it is also divisible by 100. This condition suggests the use of 'AND' in a logical comparison clause.
  2. If the year doesn't fit the first condition, for example, if the year is divisible by 4 and 100, it must also be divisible by 400 to be a leap year, otherwise it is not.

Credit: This program is a modification of a Python program found in Angela Yu's "100 Days of Code: The Complete Python Pro Bootcamp" on Udemy. You can go to the course's page by clicking the following link (not a ref. link): https://www.udemy.com/course/100-days-of-code/

About

This is the classic leap year finder program with python. This problem is labelled as "hard" on many practice sites, but actually the programming is not hard at all. What's hard is the description of the leap year and how to translate it into the programming language.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages