input: Write a function to calculate the sum of the digits in a given number. The function should return the sum of all digits in the number, starting from the rightmost digit to the leftmost digit. If the given number is empty or 0, it should return 0.
  
  assert sum_digits(12345)==15
  assert sum_digits(456)==15
  assert sum_digits(0)==0
  assert sum_digits(111111)==6
  assert sum_digits(9876543210)==45
output: def sum_digits(num):
      if num == 0:
          return 0
      total = 0
      while num > 0:
          total += num % 10
          num //= 10
      return total