You are viewing a single comment's thread. Return to all comments →
Associativity.
'a and b or c' reads like '(a and b) or c' to the interpreter.
'a and b' is only true every 400 years.
c is true every year except those divisible by 100, so you're marking only 3 years out of every 400 as non-leap years.
Seems like cookies are disabled on this browser, please enable them to open this website
Write a function
You are viewing a single comment's thread. Return to all comments →
Associativity.
'a and b or c' reads like '(a and b) or c' to the interpreter.
'a and b' is only true every 400 years.
c is true every year except those divisible by 100, so you're marking only 3 years out of every 400 as non-leap years.