You are viewing a single comment's thread. Return to all comments →
For the learners: you should know that doing something like the setup for this challenge inclines you to do is a bad practice. Never do the following:
This is just dumb. You are returning a boolean, so why even use if blocks in the first place? The correct what of doing this would be:
Because this already evaluates as a boolean.
So in this challenge, forget about ifs and elses, and that leap variable, and just do the following:
return year % 4 == 0 and (year % 400 == 0 or year % 100 != 0)
Don't be redundant, be DRY.