Skip to content

Instantly share code, notes, and snippets.

@chaewonkong
Last active November 30, 2017 06:09
Show Gist options
  • Select an option

  • Save chaewonkong/0d8efdaa9971dd839aaad21a532f52bf to your computer and use it in GitHub Desktop.

Select an option

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
'''
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