-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add Magic Number to maths algorithms #730
Conversation
Thanks a lot, @ericklarac. |
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.
Thanks a lot, @ericklarac.
Should I change anything in the file before you merge it?
@Nanak360 I added a comment on the file
algorithms/maths/magic_number.py
Outdated
# sum becomes single digit. | ||
while n > 0 or sum_total > 9: | ||
|
||
if not n: |
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 condition is only true if n equals 0, update n == 0, or add a comment for better reading
algorithms/maths/magic_number.py
Outdated
|
||
|
||
def magic_number(n): | ||
sum_total = 0 |
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.
total_sum
NOTE - in "tests/test_maths.py" I only added tests for the algorithm I added. My IDE formatted the file.
P.S. Please add "hacktoberfest-accepted" to this PR. <3