input: Write a function to create a Python class that takes a given number and calculates the sum of its digits. The class should have a method to perform the calculation. If the input number is provided, return the sum of its digits. If the input number is not provided, return 0.
  class SumOfDigits:
      
      def __init__(self, num=None):
          self.num = num if num is not None else 0
      
      def calculate_sum_of_digits(self):
          total = 0
          for ch in str(self.num):
              total += int(ch)
          return total
  
  assert SumOfDigits(6342).calculate_sum_of_digits() == 15
  assert SumOfDigits(12345).calculate_sum_of_digits() == 15
  assert SumOfDigits().calculate_sum_of_digits() == 0
  assert SumOfDigits(9876).calculate_sum_of_digits() == 30
  assert SumOfDigits("0123").calculate_sum_of_digits() == 6
output: 
  class SumOfDigits:
      
      def __init__(self, num=None):
          self.num = num if num is not None else 0
      
      def calculate_sum_of_digits(self):
          total = 0
          for ch in str(self.num):
              total += int(ch)
          return total
  