title: Creating nested dictionaries from a list
body: <p>Sorry for a 3rd similar question but I'm still trying to work through what my output would be.</p>
  <p>Ideally I would have programmatic way using a function to take a list of values and store them in a nested dictionary.</p>
  <p><code>values = [1,2.0,3.0,1,1,3,4.0,2,3.0, 2.0]</code></p>
  <p>The result of the function would provide a dictionary that looks like this:</p>
  <pre><code>types: {
  
     'int' : {
         
         '1': [1,1,1,],
         '2': [2],
         '3': [3]
         }
      'float' : {
         '2.0' : 2,
         '3.0' : 2,
         '4.0' : 1
        }
  }
  </code></pre>
  <p>Where the int dictionary just stores the occurrences of each value and the float dictionary stores the counts of the instances.</p>
  <p>This is what I have but I'm running into problems with the logic of creating the sub dictionaries.</p>
  <pre><code>values = [1,2.0,3.0,1,1,3,4.0,2,3.0, 2.0]
  
  types = {}
  for obj in values:
        k = type(obj).__name__
        types[k] = types.get(k, {})
        if isinstance(obj, int):
            types['int'] = obj
        elif isinstance(obj, float):
           types['float'][obj] = types['float'].get(obj,0)
              
  print(types)
  </code></pre>
  <p>I started with a for loop to try to figure out the logic before try the</p>
  <pre><code>def summarize_numbers(list):
  return type
  </code></pre>
  <p>function syntax</p>