-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Created problem_112.py in project_euler #2532
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
Conversation
@shellhub, @dhruvmanila would be interested in reviewing this? |
Co-authored-by: Dhruv <[email protected]>
Co-authored-by: Du Yuanchao <[email protected]>
Please test from percent from 1 to 99. I think i will won’t run forever.
Kushagra Bansal <[email protected]>于2020年10月1日 周四17:09写道:
…
***@***.**** commented on this pull request.
------------------------------
In project_euler/problem_112/sol1.py
<#2532 (comment)>:
> + ...
+ ValueError: solution() only accepts values from 0 to 100
+ >>> solution(100.011)
+ Traceback (most recent call last):
+ ...
+ ValueError: solution() only accepts values from 0 to 100
+ """
+ if percent >= 100:
+ raise ValueError("solution() only accepts values from 0 to 100")
+ bouncy_num = 0
+ num = 1
+
+ while True:
+ if check_bouncy(num):
+ bouncy_num += 1
+ if (bouncy_num / num) * 100 >= percent:
For 99% per cent, it will find an exact integer. But for some given
percentages, the number will number be exactly as the input per cent and if
I put == the program will run forever, so I have to put >=
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2532 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHYQFV6T24IYTQ2VMDA46HTSIRBNTANCNFSM4R7OISPQ>
.
|
But you can have |
Co-authored-by: Du Yuanchao <[email protected]>
I think it can be merged now. |
@Kush1101 Do you mean that if we keep the |
Travis CI tests. |
@cclauss I think it's up to you now. Can you review it? |
I don't think so because almost all the |
|
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.
delete empty line. and try it.
Merging is blocked as @shellhub requested some changes. Maybe only he can merge this? |
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.
LGTM.
* Add files via upload * Create __init__.py * Update and rename project_euler/problem_112.py to project_euler/problem_112/sol1.py * Update project_euler/problem_112/sol1.py Co-authored-by: Dhruv <[email protected]> * Update sol1.py * Update sol1.py * Update project_euler/problem_112/sol1.py Co-authored-by: Du Yuanchao <[email protected]> * Update project_euler/problem_112/__init__.py Co-authored-by: Du Yuanchao <[email protected]> * Update __init__.py * Update __init__.py * Update __init__.py * delete __init__.py content Co-authored-by: Dhruv <[email protected]> Co-authored-by: Du Yuanchao <[email protected]>
* Add files via upload * Create __init__.py * Update and rename project_euler/problem_112.py to project_euler/problem_112/sol1.py * Update project_euler/problem_112/sol1.py Co-authored-by: Dhruv <[email protected]> * Update sol1.py * Update sol1.py * Update project_euler/problem_112/sol1.py Co-authored-by: Du Yuanchao <[email protected]> * Update project_euler/problem_112/__init__.py Co-authored-by: Du Yuanchao <[email protected]> * Update __init__.py * Update __init__.py * Update __init__.py * delete __init__.py content Co-authored-by: Dhruv <[email protected]> Co-authored-by: Du Yuanchao <[email protected]>
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.