title: finding probability of values in dictionary
body: <p>I have a default dict which looks like this:</p>
  
  <pre><code>my_dict = default(dict, {"K": {"k": 2, "x": 1.0}, "S": {"_":1.0, "s":1},    "EH": {"e":1.0}})
  </code></pre>
  
  <p>The keys are phonemes, and values that are dictionaries themselves are graphemes which occur a certain amount of times, which are the respective numbers in the default dict. </p>
  
  <p>The function should return another default dict containing the probabilities, which will look like this:</p>
  
  <pre><code>defaultdict(&lt;class 'dict'&gt;, {'EH': {'e': 1.0}, 'K': {'k': 0.6666666666666666, 'x': 0.3333333333333333}, 'S': {'_': 0.5, 's': 0.5}})
  </code></pre>
  
  <p>'e' remains the same, as 1.0/1 = 1.0. 'K' has values of 0.66666 and 0.33333 because 2/3 = 0.66666 and 1/3 = 0.3333333. 'S' has values of 0.5 and 0.5, because 1/2=0.5 for each of them. The probabilities in the return dict must always sum to one. </p>
  
  <p>so far I have this:</p>
  
  <pre><code>from collections import defaultdict   
  
  my_dict = default(dict, {"K": {"k": 2, "x": 1.0}, "S": {"_":1.0, "s":1},      "EH": {"e":1.0}})
  
  def dict_probability(my_dict):
  
     return_dict = defaultdict(dict)
  
     for char in my_dict.values():
  </code></pre>