input: Write a function to calculate the sum of the digits of a given number. If the given number is empty or None, return 0. 
  
  def sum_of_digits(num):
      if num is None or num == "":
          return 0
      return sum(int(ch) for ch in str(num))
  
  assert sum_of_digits(6342) == 15
  assert sum_of_digits(12345) == 15
  assert sum_of_digits("") == 0
  assert sum_of_digits(None) == 0
  assert sum_of_digits(987654321) == 45
  assert sum_of_digits("123") == 6
  assert sum_of_digits("0") == 0
output: def sum_of_digits(num):
      if num is None or num == "":
          return 0
      return sum(int(ch) for ch in str(num))