Last active
November 30, 2017 06:09
-
-
Save chaewonkong/0d8efdaa9971dd839aaad21a532f52bf to your computer and use it in GitHub Desktop.
Leap Year Calculator: Gets input of year in number, then tells whether it is leap year or ordinary year
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Leap Year Calculator | |
| If you put a year in number(like 1992 or 2000), the program will tell you whether it is leap year or not. | |
| ''' | |
| #Get an year number as an input | |
| year_input = int(input("Please enter a year that you want to know:")) | |
| #In order to be a leap year, the number of the year should be multiples of 4, or multiples of 400 meanwhile, | |
| # it shouldn't be multiples of 100(excluding multiples of 400) | |
| if year_input%400==0 or year_input%4==0 and year_input%100!=0: | |
| print("It is a Leap Year") | |
| else: | |
| print("It's an Ordinary Year") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment