Question #298017

leap year or not, divisible by 100 , 400(leap year)

divisible by 4 (non leap year i.e false

input:2016

output:true


Expert's answer

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))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS