Mind blown. Any every hear of the rule for leap years? It’s more complex than I thought. The yeast must be Evenly divisible by four, unless it’s divisible by 100- then it’s not. Unless it’s also divisible by 400, then it is a leap year. So 1900 wasn’t a leap year but 2000 was. I need to write a Python program for this and it’s not as easy as I thought it was.
Log in to join in Reading is open to everyone. Replying needs an account.
1 comment
Here you go: year = 2021 if (year % 4) == 0: if (year % 100) == 0: if (year % 400) == 0: print("{0} is a leap year".format(year)) else: print("{0} is not a leap year".format(year)) else: print("{0} is a leap year".format(year)) else: print("{0} is not a leap year".format(year))