how to one line sum digits of one number python 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