title: Reading a file and appending to a dictionary
body: <p>I'm running into troubles appending data into a dictionary.</p>
  
  <p>data:</p>
  
  <pre><code>string integer 
  string integer 
  string integer 
  string integer 
  </code></pre>
  
  <p>the text file on notepad it looks like:</p>
  
  <pre><code>STRING 13STRING 4STRING 1STRING 4STRING 2STRING 7
  </code></pre>
  
  <p>Initially one of the strings were missing an integer, I just added one into the text file and saved it to first make sure I can append the info into a dictionary</p>
  
  <p>code:</p>
  
  <pre><code>d = {}
  file = open('data.txt','r')
  for line in file:
      data = line.split()
      key, value = data[0], data[1]
      d[key] = value
  print(d)
  </code></pre>