input: 
  from typing import List
  
  
  def sum_digits(num: int) -> int:
      """Calculate the sum of the digits in a given number.
      >>> sum_digits(123)
      6
      >>> sum_digits(4567)
      22
      >>> sum_digits(9999)
      36
      """
  
output:     total = 0
      while num > 0:
          total += num % 10
          num //= 10
      return total