input: Write a function in Python to calculate the sum of the digits in a given number.
  
  ### Function:
  
  def sum_digits(num):
      total = 0
      while num > 0:
          digit = num % 10
          total += digit
          num = num // 10
      return total
  
  
  ### Test Cases:
  
  assert sum_digits(12345) == 15
  assert sum_digits(9876) == 30
  assert sum_digits(0) == 0
  assert sum_digits(1) == 1
  assert sum_digits(101) == 2
  
output: def sum_digits(num):
      total = 0
      while num > 0:
          digit = num % 10
          total += digit
          num = num // 10
      return total