TODO: We have that problem with different wording: https://profound.academy/python-introduction/yP8AVKtLyzLme5EGx6ZZ.
Given an integer
n, we can compute the digital root of
nby summing up all the digits of
nand repeating that process on the result until reaching a single digit. The digital sum of a number is the result of an iterative process of summing the digits of the number. You are asked to write a program that would calculate the digital root of a number.
The input contains a single integer
n(0 ≤ n ≤ ).
The program should print the digital root of the number
- 15 → 1 + 5 = 6
- 12345 → 1 + 2 + 3 + 4 + 5 = 15 → 1 + 5 = 6