Python Program to find the sum of digits in a number code example
Example: python sum of digits
def sum_digits(n):
s = 0
while n:
s += n % 10
n //= 10
return s
def sum_digits(n):
s = 0
while n:
s += n % 10
n //= 10
return s