def g(n):
s = 0
while n >= 1:
s = s + n % 10
n = n // 10
if s // 10 == 0:
return s
else:
g(s)
n = 0
while n != -1:
n = int(input())
print(g(n))
the sum up a integer until it reaches to a 1 digit number . for example n= 29
2+9=11
1+1=2
so the function should return 2 . but it return "None" . Can anyone please help me where the wrong is ?