title: Python: create sub-dictionary from dictionary
body: <p>I have a python dictionary, say </p>
  
  <pre><code>dic = {"aa": 1,
         "bb": 2, 
         "cc": 3, 
         "dd": 4, 
         "ee": 5, 
         "ff": 6, 
         "gg": 7, 
         "hh": 8, 
         "ii": 9}
  </code></pre>
  
  <p>I want to make list of sub-dictionary elements of having length 3 like</p>
  
  <pre><code>dic = [{"aa": 1, "bb": 2, "cc": 3},
         {"dd": 4, "ee": 5, "ff": 6},
         {"gg": 7, "hh": 8, "ii": 9}]
  </code></pre>
  
  <p>I came with following code :</p>
  
  <pre><code>dic = {"aa": 1,
         "bb": 2, 
         "cc": 3, 
         "dd": 4, 
         "ee": 5, 
         "ff": 6, 
         "gg": 7, 
         "hh": 8, 
         "ii": 9}
  i = 0
  dc = {}
  for k, v in dic.items():
      if i==0 or i==3 or i==6:
         dc = {}
         dc[k] = v
      if i==2 or i==5 or i==8:
         print dc
         i = i + 1
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>{'aa': 1, 'ee': 5, 'hh': 8}
  {'cc': 3, 'bb': 2, 'ff': 6}
  {'ii': 9, 'gg': 7, 'dd': 4}
  </code></pre>
  
  <p>any pythonic way to do same stuff?</p>