Skip to content
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

Merged
merged 5 commits into from
Oct 29, 2020

Conversation

Nanak360
Copy link
Contributor

  • New Algorithm added - Magic Number
  • Updated Readme
  • Added Tests for algorithm

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

@Nanak360
Copy link
Contributor Author

Thanks a lot, @ericklarac.
Should I change anything in the file before you merge it?

Copy link
Collaborator

@ericklarac ericklarac left a 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

# sum becomes single digit.
while n > 0 or sum_total > 9:

if not n:
Copy link
Collaborator

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



def magic_number(n):
sum_total = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

total_sum

@ericklarac ericklarac merged commit 422b1d1 into keon:master Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants