title: How add dictionary inside another dictionary using loops?
body: <pre><code>index = 0
  while (condition) :
      ...
      mydict = {"key1":[values], "key2":[values], "key3":[values]}
      somefunction(mydict)
  
   def somefunc(mydict):
       maindict[index] = mydict
       index = index + 1
       return mydict
   print maindict
  </code></pre>
  
  <p>Output should be like this     </p>
  
  <pre><code> maindict = {0:{key1:[values]...}
               1:{key1:[values]...}
               .
               .
               }
  </code></pre>
  
  <p>I'm parsing a file and it contains many data, when the while loop satisfies i get the dictionary called mydict, and i want to add that value into main dictionary using index like 0,1,2.. everytime the loop satifies?</p>