Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
double recursion without str solution in Clear category for Sum of Digits by juestr
def sum_digits(n):
if n < 10:
return n
else:
d, r = divmod(n, 10)
return sum_digits(d + sum_digits(r))
Sept. 12, 2022
Comments: