Python Program to Checking Leap Year

Introduction

Following program is used to find out the given year is leap year on not.
 
Code: 
  1. #Python Program to check Given Year is leap year or not  
  2. Year = int(input("Please Enter a Year to check it is leap Year or not : "))  
  3. if (Year % 400 == 0):  
  4.     print("%d is a leap Year."%Year)  
  5. elif (Year % 100 == 0):  
  6.     print("%d is not a leap Year."%Year)  
  7. elif (Year % 4 == 0):  
  8.     print("%d is a leap Year."%Year)  
  9. else:  
  10.     print("%d is not a leap Year."%Year)    
  11.    
Output:

 
 
Ebook Download
View all
Python
Read by 0 people
Download Now!
Learn
View all
sourabhsomani.com