Skip to content

Comments

Add sum_of_digits implementation in Python#13795

Closed
agarwalpranay02 wants to merge 1 commit intoTheAlgorithms:masterfrom
agarwalpranay02:add-sum-of-digits-1
Closed

Add sum_of_digits implementation in Python#13795
agarwalpranay02 wants to merge 1 commit intoTheAlgorithms:masterfrom
agarwalpranay02:add-sum-of-digits-1

Conversation

@agarwalpranay02
Copy link

Describe your change

  • Add an algorithm

Added an iterative implementation to compute sum of decimal digits at maths/add_digits.py.
Includes doctest examples and input validation. Beginner-friendly contribution for Hacktoberfest.

Checklist

  • I have read CONTRIBUTING.md
  • This pull request is all my own work and I have not plagiarized.
  • I know this PR will not be merged if it fails the automated tests.
  • This PR only changes one algorithm file.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with type hints.
  • All functions have docstrings and pass automated testing.
  • Includes at least one URL reference to explanation.

Reference: https://en.wikipedia.org/wiki/Digital_root

@algorithms-keeper algorithms-keeper bot added the awaiting reviews This PR is ready to be reviewed label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants