python program to find sum of digits of 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