def digital_root(n):
if n > 0:
a.append(n%10)
if n/10 > 0:
digital_root(n/10)
else:
if len(a) > 1:
b = a
a.clear()
z = 0
for i in range(len(b)):
z += b[i]
digital_root(z)
else:
return a[0]
why it returns None?
task is: Given n, take the sum of the digits of n. If that value has more than one digit, continue reducing in this way until a single-digit number is produced. The input will be a non-negative integer.