kk
unknown
python
2 years ago
369 B
4
Indexable
#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")
Editor is loading...