Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

python--i need help with this question..write a program that can detect whether a year is a leap year or not.."if a year is divisible by 400 and 4 but not 100,is a leap year",how cn i write this in python? healp pls

OpenStudy (cybershadow):

#first we need to define a function def LeapOrNot(x): if x%400==0 and x%4 == 0 and x%100 != 0: return "given year is leap year" else: return "given year is not a leap year" #call this function later, for e.g. LeapOrNot(2004)

OpenStudy (anonymous):

thanx a lot,it is working

OpenStudy (cybershadow):

no worries

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!