-
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 Krishnamurty Number to Math algorithms #728
Conversation
Could you add some tests under the test folder? |
Yes, I'll surely do that @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.
Add some test and add your implementation to the readme, you can use this merged PR as a guide
return fact | ||
|
||
|
||
def checkKrishnamurthy(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.
Use snake case
|
||
|
||
def checkKrishnamurthy(n): | ||
sumOfDigits = 0 # will hold sum of FACTORIAL of digits |
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.
Also, se snake case for the variables
For some reason, the tests failed. |
Traceback (most recent call last): The factorial function was previously defined in other file. You are exporting your function, and it is overriding the other function. A workaround could be to rename the |
Okay, I am doing the changes. |
Yaaaeee...!!!! |
I have added the Krishnamurthy Number checker algorithm. This is a common algorithm that is pretty famous here in India especially from a beginner's perspective.
Talking of Krishnamurthy number, it's a number whose sum total of the factorials of each digit is equal to the number itself.
hacktoberfest-accepted