+ 9
Create a program to find leap year or not like input=2008, output =True
Task : You are given the year, and you have to write a function to check if the year is leap or not. Note that you have to complete the function and remaining code is given as template. Input Format : Read y, the year that needs to be checked. Output Format : Output is taken care of by the template. Your function must return a boolean value (True/False) https://code.sololearn.com/cdS5MwnW1k8C/?ref=app
3 Antworten
+ 2
D_Stark Yours gives the same results as mine. Job done. Another fun challenge ☺
https://code.sololearn.com/c7v705SH4AY4/?ref=app
+ 7
following @Xan rules i think this is right as i know nothing about leap years 😂
https://code.sololearn.com/cEJgXKO07aGD/?ref=app
+ 3
You've missed out some leap year rules:
http://www.wwu.edu/skywise/leapyear.html
"There is a leap year every year whose number is perfectly divisible by four - except for years which are both divisible by 100 and not divisible by 400. The second part of the rule effects century years. For example; the century years 1600 and 2000 are leap years, but the century years 1700, 1800, and 1900 are not. This means that three times out of every four hundred years there are eight years between leap years."