You are viewing a single comment's thread. Return to all comments →
You don't even need expression != 0 in boolean logic. You can reduce the function to:
expression != 0
def is_leap(year): return not(year % 4 or (not year % 100 and year % 400))
But you could argue that obfuscates the intent.
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 →
You don't even need
expression != 0
in boolean logic. You can reduce the function to:But you could argue that obfuscates the intent.