-
-
Notifications
You must be signed in to change notification settings - Fork 46.5k
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
Updated problem_04 in project_euler #2427
Conversation
project_euler/problem_04/sol1.py
Outdated
>>> solution(10000) | ||
Traceback (most recent call last): | ||
... | ||
ValueError: No such latest palindrome number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Let's move this test below the others so we show how the function works before we show how it breaks,
project_euler/problem_04/sol1.py
Outdated
return number | ||
divisor -= 1 | ||
raise ValueError("No such latest palindrome number.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message is incorrect. It is not the the number does not exist, it is that it is larger than our acceptable range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an error message ? Thanks
Why we need change 3 to 3.0 like this |
Given that 3 == 3.0, it is not necessary but...
|
* Updated problem_04 in project_euler * fixup! Format Python code with psf/black push * That number is larger than our acceptable range. * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.