Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python Program to check if a given year is leap year

# Python program to check leap year or not
def checkYear(year):
    if (year % 4) == 0:
        if (year % 100) == 0:
            if (year % 400) == 0:
                return True
            else:
                return False
        else:
             return True
    else:
        return False
 
# Driver Code
year = 2000
if(checkYear(year)):
    print("Leap Year")
else:
    print("Not a Leap Year")
     
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #python #Program #check #year #leap #year
ADD COMMENT
Topic
Name
7+4 =