input: def SumOfDigits(num: int) -> int:
      """
      Calculate the sum of the digits of a given number.
      Example:
      >>> SumOfDigits(6342)
      15
      """
output:     sum = 0
      while num > 0:
          sum += num % 10
          num //= 10
      return sum