Write a correct Python program to find the sum of all the digits of an integer.
def sum_of_digits(n):
   """Find the sum of all the digits of an integer n"""
   s = 0
   while n:
       s += n % 10
       n //= 10
   return s