pkx8326 / leapyear_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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.


Languages

Language:Python 100.0%