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
digital root method #6140
base: master
Are you sure you want to change the base?
digital root method #6140
Conversation
fixed syntax, readibility, indentation
@poyea , sorry to disturb, the pre-commits in my pull requests keep failing although everything seems alright with the code. the workflow keeps telling me to add blank lines, but it never lets the checks go through even when i add them. could you please reccomend something to fix this issue? |
fixed pre-commit issues
|
fixed the Value Error [ 73d line ]
@Kush1101 could you please check out this pull request? |
added an exception for an invalid input, as well as tests regarding it.
@Kush1101 could you please check out this pull request? |
try: | ||
return n % 9 or n and 9 if n >= 0 else "Input wasn't valid" | ||
except TypeError: | ||
return "Please enter a non-negative integer" |
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.
try: | |
return n % 9 or n and 9 if n >= 0 else "Input wasn't valid" | |
except TypeError: | |
return "Please enter a non-negative integer" | |
try: | |
return n % 9 or n and 9 if n >= 0 else "Input wasn't valid" | |
except TypeError: | |
return "Please enter a non-negative integer" |
Describe your change:
added the 'digital_root' method to maths/sum_of_digits.py.
a digital root is: https://en.wikipedia.org/wiki/Digital_root
Checklist:
Fixes: #{$ISSUE_NO}
.