📅  最后修改于: 2022-03-11 14:45:36.660000             🧑  作者: Mango
>>> def sum_digits(n):
"""Return the sum of the digits of positive integer n."""
if n < 10:
return n
else:
all_but_last, last = n // 10, n % 10
return sum_digits(all_but_last) + last