input: Write a function to calculate the sum of the digits of a given number. The function should take an integer as input and return the sum of its digits as an integer.
  assert sum_of_digits(6342)==15
  assert sum_of_digits(123)==6
  assert sum_of_digits(999)==27
  assert sum_of_digits(0)==0
  assert sum_of_digits(456789)==39
output: def sum_of_digits(n):
      return sum(int(digit) for digit in str(abs(n)))