title: Python appending to a dictionary list
body: <p>So I have a text file with a list of two numbers then a new line with another two numbers and so on. Example would be:</p>
  
  <pre><code>     2000 5000
       2000 5001
       3000 5000 
       4000 7777
        ......
  </code></pre>
  
  <p>I'm trying to create a dictionary that will have a key increment by 1 for every new number in the first index when reading the line and have the value be a list with both the first number and the second number in the text file. so for my example i would like to have</p>
  
  <pre><code>{0: ['2000', '5000', '5001'], 1: ['3000', 5000'], 2: ['4000', '7777']}
  </code></pre>
  
  <p>I've already read in the file hence the first 3 lines of the code</p>
  
  <p>My code is as followed</p>
  
  <pre><code>    testing = {}
      count = 0
      for i in range(len(lines)):
        x = (lines[i].split(' '))
        if x[0] in testing:
           testing[count].append(x[1])
        else:
           testing[count] =x[0]
           testing[count].append(x[1])
  
           count += 1
  </code></pre>
  
  <p>The problem im getting is that its only printing out one dictionary key and value.</p>