kk

mail@pastecode.io avatar
unknown
python
a month ago
369 B
0
Indexable
Never
#Check whether the year is leap or not ? 

def is_leap(year):
    leap = False
    if year % 4 == 0:
        leap = True
    elif year % 100 == 0:
            leap = False
    elif year % 400 == 0:
                leap = True 
    return leap
year = 2004
if is_leap(year):
    print(year, "is a leap year")
else:
    print(year, "is not a leap year")