Q6Numerical3 Marks10 May 2026
What is the output? Note : The function divmod(a,b) gives two values: (quotient : a // b , remainder : a % b) for example: divmod(27, 10) gives (2, 7)
```
def g(n):
def reduce_once(x):
s = 0
while x:
x, r = divmod(x, 10)
s += r
return s
return n if n < 10 else g(reduce_once(n))
print(g(999))
```
Enter an integer as your answer.
Press Enter to check.