input: def SumOfDigits:
      """ Construct a Python class that takes a given number and calculates the sum of the digits.
      Example:
      >>> digit_sum = SumOfDigits(6342)
      >>> digit_sum.calculate_sum_of_digits()
      15
      """
      
      def __init__(self, num):
          self.num = num
      
      def calculate_sum_of_digits(self):
          total = 0
          for ch in str(self.num):
              total += int(ch)
          return total
  
  digit_sum = SumOfDigits(6342)
  result = digit_sum.calculate_sum_of_digits()
  print(result)
output:     
      def __init__(self, num):
          self.num = num
      
      def calculate_sum_of_digits(self):
          total = 0
          for ch in str(self.num):
              total += int(ch)
          return total
  
  digit_sum = SumOfDigits(6342)
  result = digit_sum.calculate_sum_of_digits()
  print(result)
  