We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Because the comparison operators in the example above, == and != evaluate to a boolean value:
If 4 can be evenly divided into y (that is, there is no remainder, so y % 4 == 0), that returns True. Then, the second part of the statement includes an OR, so either y % 100 != 0 or y % 400 == 0 needs to be true.
Write a function
You are viewing a single comment's thread. Return to all comments →
Because the comparison operators in the example above, == and != evaluate to a boolean value: If 4 can be evenly divided into y (that is, there is no remainder, so y % 4 == 0), that returns True. Then, the second part of the statement includes an OR, so either y % 100 != 0 or y % 400 == 0 needs to be true.
You can find more info on this here: https://docs.python.org/3/reference/expressions.html#comparisons