Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isLeapYear 可能是笔误,不过应该加上() #2

Open
nonocoke opened this issue Jun 6, 2018 · 2 comments
Open

isLeapYear 可能是笔误,不过应该加上() #2

nonocoke opened this issue Jun 6, 2018 · 2 comments

Comments

@nonocoke
Copy link
Contributor

nonocoke commented Jun 6, 2018

def isLeapYear(year):
# return (not year % 4 and year % 100) or (not year % 400)
return (not (year % 4 and year % 100)) or (not year % 400)

@nonocoke nonocoke changed the title 可能是笔误,不过应该加上() isLeapYear 可能是笔误,不过应该加上() Jun 6, 2018
@yidao620c
Copy link
Owner

thanks, you can apply a pull request

@pluieciel
Copy link
Contributor

def isLeapYear(year):

return (not year % 4 and year % 100) or (not year % 400)

return (not (year % 4 and year % 100)) or (not year % 400)

原来的没错,1900年不是闰年

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants