Input Format
Read y, the year that needs to be checked.
Constraints
Output Format
The output is taken care of by the template. Your function must return a boolean value (True/False)
hackerrank write a function problem solution in python

Problem solution in python 2 programming language.

def is_leap(n):
    if n % 400 == 0:
        return True
    if n % 100 == 0:
        return False
    if n % 4 == 0:
        return True
    return False

print is_leap(input())

Second solution

def is_leap(year):
    return (year % 400 == 0) or (( year % 100 != 0) and (year % 4 == 0))
    
print is_leap(input())

Problem solution in python 3 programming language.

def is_leap(n):
    if n % 400 == 0:
        return True
    if n % 100 == 0:
        return False
    if n % 4 == 0:
        return True
    return False

print(is_leap(int(input())))