input: Write a function to calculate the sum of the digits in a given number and return the result. The function should take an integer num as input and return an integer that is the sum of its digits. If the input number is negative, consider the absolute value of the number for calculation.
  
  def sum_digits(num):
      if num < 0:
          num = abs(num)
      total = 0
      while num > 0:
          digit = num % 10
          total += digit
          num = num // 10
      return total
  
  assert sum_digits(123) == 6
  assert sum_digits(456) == 15
  assert sum_digits(-789) == 24
  assert sum_digits(0) == 0
output: def sum_digits(num):
      if num < 0:
          num = abs(num)
      total = 0
      while num > 0:
          digit = num % 10
          total += digit
          num = num // 10
      return total