input: def findMaxValue(dict):
      """Find the maximum value within a nested dictionary.
      >>> findMaxValue({"key1": {"value1": 10, "value2": 20}, "key2": {"value3": 40}})
      40
      >>> findMaxValue({"key1": {"value1": 5, "value2": 15}, "key2": {"value3": 7}})
      15
      """
      max_val = None
      for key, value in dict.items():
          if isinstance(value, dict):
              max_val = max(findMaxValue(value), max_val)
          else:
              max_val = max(value, max_val)
      return max_val
output:     if max_val is None:
          return None
      return max_val