input: from typing import Dict, Union
  
  def dict_sum(dictionary: Dict[str, Union[int, float]]) -> Union[int, float]:
      """ Compute the sum of the values in a given dictionary with string keys mapping to integers or floats.
      >>> dict_sum({'A': 5, 'B': 6, 'C': 10})
      21
      >>> dict_sum({'X': 3.5, 'Y': 7.2, 'Z': 2})
      12.7
      """
output:     total = 0
      for value in dictionary.values():
          total += value
      return total