Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCreated problem_112.py in project_euler #2532
Conversation
|
@shellhub, @dhruvmanila would be interested in reviewing this? |
Co-authored-by: Dhruv <dhruvmanila@gmail.com>
Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
|
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写道:
…
*@Kush1101* 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 |
|
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 |
|
|
delete empty line. and try it. |
|
Merging is blocked as @shellhub requested some changes. Maybe only he can merge this? |
|
LGTM. |
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.