title: Creating a dictionary with list of lists in Python
body: <p>I have a huge file (with around 200k inputs). The inputs are in the form:</p>
  
  <pre><code>A B C D
  B E F
  C A B D
  D  
  </code></pre>
  
  <p>I am reading this file and storing it in a list as follows:</p>
  
  <pre><code>text = f.read().split('\n')
  </code></pre>
  
  <p>This splits the file whenever it sees a new line. Hence text is like follows:</p>
  
  <pre><code>[[A B C D] [B E F] [C A B D] [D]]
  </code></pre>
  
  <p>I have to now store these values in a dictionary where the key values are the first element from each list. i.e the keys will be A, B, C, D. 
  I am finding it difficult to enter the values as the remaining elements of the list. i.e the dictionary should look like:</p>
  
  <pre><code>{A: [B C D]; B: [E F]; C: [A B D]; D: []}
  </code></pre>
  
  <p>I have done the following:</p>
  
  <pre><code>    inlinkDict = {}
      for doc in text:
      adoc= doc.split(' ')
      docid = adoc[0]
      inlinkDict[docid] = inlinkDict.get(docid,0) +  {I do not understand what to put in here}
  </code></pre>
  
  <p>Please help as to how should i add the values to my dictionary. It should be 0 if there are no elements in the list except for the one which will be the key value. Like in example for 0.</p>