leap year or not, divisible by 100 , 400(leap year)
divisible by 4 (non leap year i.e false
input:2016
output:true
def is_leap(year):
if year%400 == 0:
return True
elif year%100 == 0:
return False
elif year%4 == 0:
return True
else:
return False
year = int(input())
print(is_leap(year))
Comments
Leave a comment