Uh oh!
There was an error while loading. Please reload this page.
Created problem_112.py in project_euler - #2532
Conversation
Kush1101
commented
Oct 1, 2020
@shellhub, @dhruvmanila would be interested in reviewing this? |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Dhruv <dhruvmanila@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
realDuYuanChao
commented
Oct 1, 2020
via email
Please test from percent from 1 to 99. I think i will won’t run forever.
Kushagra Bansal <notifications@github.com>于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 |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
Kush1101
commented
Oct 1, 2020
I think it can be merged now. |
dhruvmanila
commented
Oct 2, 2020
@Kush1101 Do you mean that if we keep the |
Kush1101
commented
Oct 2, 2020
Travis CI tests. |
Kush1101
commented
Oct 2, 2020
@cclauss I think it's up to you now. Can you review it? |
dhruvmanila
commented
Oct 2, 2020
I don't think so because almost all the |
|
realDuYuanChao
left a comment
There was a problem hiding this comment.
delete empty line. and try it.
Uh oh!
There was an error while loading. Please reload this page.
dhruvmanila
commented
Oct 3, 2020
Merging is blocked as @shellhub requested some changes. Maybe only he can merge this? |
* 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 <dhruvmanila@gmail.com> * Update sol1.py * Update sol1.py * Update project_euler/problem_112/sol1.py Co-authored-by: Du Yuanchao <shellhub.me@gmail.com> * Update project_euler/problem_112/__init__.py Co-authored-by: Du Yuanchao <shellhub.me@gmail.com> * Update __init__.py * Update __init__.py * Update __init__.py * delete __init__.py content Co-authored-by: Dhruv <dhruvmanila@gmail.com> Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
* 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 <dhruvmanila@gmail.com> * Update sol1.py * Update sol1.py * Update project_euler/problem_112/sol1.py Co-authored-by: Du Yuanchao <shellhub.me@gmail.com> * Update project_euler/problem_112/__init__.py Co-authored-by: Du Yuanchao <shellhub.me@gmail.com> * Update __init__.py * Update __init__.py * Update __init__.py * delete __init__.py content Co-authored-by: Dhruv <dhruvmanila@gmail.com> Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.