title: Python: How to read a text file into a dictionary when each key and value is on a new line?
body: <p>I'm sure there is an example of this somewhere already but I haven't been able to find it.
  I have a text file that looks like this:</p>
  <p>apple<br />
  1<br />
  orange<br />
  3<br />
  pear<br />
  6<br />
  plum<br />
  8</p>
  <p>etc...</p>
  <p>I want to make a dictionary where the keys are the string of each fruit and the corresponding values to be the line below it. When I tried delimiting with the newline character '\n', it created a dictionary with every line as a key and empty corresponding values. How can I achieve this?</p>
  <p>Here is my current code for reference:</p>
  <pre><code>fruit_dict = {}
  with open('fruit.txt') as file_object:
      for line in file_object:
          (key, val) = line.split('\n')
          fruit_dict[key] = val
  </code></pre>