Answer to Question #298017 in Python for sruthi

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


1
Expert's answer
2022-02-16T14:55:09-0500
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS